Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am including graphics from .pdf files into my latex document using the graphicx package. Some objects in the graphics files extend beyond the pdf page area, which is used as the bounding box for \includegraphics.

I would like to use the bbox for uniform positioning/sizing of all my graphics, but occasionally have objects extend beyond the bbox onto the page.

The graphicx documentation states

If * is omitted, then any part of the graphic that is outside the specified ‘bounding box’ will over-print the surrounding text.

... which is exactly what I'd like, but the .pdf file generated by pdflatex crops the images to the bounding box, even if I explicitly use

\includegraphics[clip=false]{inkclip}

I have this problem with .pdf files generated in CorelDraw as well as Inkscape, both of which show each others files having objects extending beyond page border, so I am sure the information about these objects is included in the pdf files.

Edit: I've played around some more and it seems to be a problem related to pdflatex. Using latex and then going dvi->ps->pdf, things work the way I want them to. I've attached an EPS file for use with latex and a PDF file for use with pdflatex to show the difference:

Inkscape-generated PDF

Inkscape-generated EPS

share|improve this question
2  
It would be useful if you could upload one of the conflictive pdf figures to some server (dropbox, tempshare, senduit, ...). –  JLDiaz Dec 6 '12 at 10:40
    
I've edited the question, adding links to both of the files mentioned. I wasn't sure whether to comment on this, but I got the impression noone noticed since the comment got votes after I edited... –  Lichtkarussell Dec 6 '12 at 14:31
    
Adding a comment about an edition requested in another comment is useful, since I was notified when you commented, but not when you edited. Thanks –  JLDiaz Dec 6 '12 at 15:05
    
When I open any of the linked pdfs, I see a rectangle which fills most of the page and a crossing line which extends beyond that rectangle, till the page border. Since the margins around the rectangle are narrow, only a small part of the line is visible. I assume that the line extends much more, but none of the pdf viewers I tried shows anything out of the page borders. Which one do you use which can show it? If what I saw is what you see, then I had no problem including it in a latex document. –  JLDiaz Dec 6 '12 at 15:12
    
Inkscape (not exactly a viewer, I know, but it shows the data is in the files somehow). It interprets both files exactly as I intend them: A page mostly filled with a rectangle, and a line extending beyond the page border onto the surrounding workspace. –  Lichtkarussell Dec 6 '12 at 15:59
add comment

1 Answer

up vote 5 down vote accepted

You are drawing outside the media size in Inkscape and CorelDraw. Then you export/print to PDF. But Inkscape uses the same media size for the PDF file. The graphics package that loads the PDF file (e.g., driver pdftex.def) only sees the media size. Also the Inkscape/Coreldraw might drop objects outside the media size. Even if the PDF file is manipulated by changing the /MediaBox and /CropBox values, there might be missing objects.

In Inkscape you can modify the "document settings" ("file" menu). It offers a button for fitting the page/media size to the contents. With German localization:
"Datei"->"Dokumenteneinstellungen"->"Seite in Auswahl einpassen" (Addition:) Inkscape also allows the export of the whole drawing.

Likely CorelDraw also allows to change the media/paper size.

Then again export to PDF to get all objects on the page.

There options viewport and trim to get a smaller active bounding box for \includegraphics and overlapping areas (clip is disabled by default).

share|improve this answer
    
I am drawing outside the page (later to become the bounding box) on purpose. The quote from the 'graphicx' manual in my post made me assume it would somehow be possible to include such objects. To be clear: I do not want the page/bbox to be tight fit to the objects. I need objects to, as the cited manual says, "over-print the surrounding text, using the pdf page size for positioning, not for cropping. –  Lichtkarussell Dec 6 '12 at 15:52
1  
If you want to have a smaller "bounding box", with overprinting, then still use the correct media size that contains all objects. Options viewport and trim allows the setting of the smaller "bounding box". Clipping is off by default. –  Heiko Oberdiek Dec 6 '12 at 15:56
    
I would like to avoid this workaround, because all my graphs extend beyond their page by different amounts. I have found that using .eps files with latex to generate dvi->ps->pdf gives me the desired results. Is the difference inherent to pdflatex for some reason? –  Lichtkarussell Dec 6 '12 at 16:39
    
@Lichtkarussell then what you want is impossible, because the PDF file more-or-less cannot contain the information outside the page, and if it can, it is far from being bullet-proof. EPS is different, you can adjust a bounding box to whatever you want, still keeping all the information. –  tohecz Dec 6 '12 at 17:51
1  
@Lichtkarussell You can edit the PDF files, both examples didn't use object stream compression, thus /MediaBox (Inkscape+CorelDraw) and /CropBox (CorelDraw) can be easily edited. Important is only that /MediaBox/CropBox and the number of bytes does not change! –  Heiko Oberdiek Dec 7 '12 at 0:00
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.