Graphics, Figures & Tables ⇒ error while pdf image insertion
-
- Posts: 20
- Joined: Wed Dec 22, 2010 10:21 pm
error while pdf image insertion
I was trying to upload pdf images with file names edited1, edited2, edited3. Please see the attached files in png format and tex file. I converted pdf format image to png format because of minimum size allowed to upload. While I ran pdflates sample.tex, The images are inserted, but I don't see the labels of images. Missing Figure 3(a), Figure 3(b) and so on.... Please let me know how can I get the full image inserted in document.
- Attachments
-
- png format instead of pdf format, because of limited size allowable
- edited1.png (8.86 KiB) Viewed 8587 times
-
- sample.tex
- (3.43 KiB) Downloaded 327 times
-
- sample.pdf
- (86.34 KiB) Downloaded 235 times
Last edited by john_latex on Mon Jan 03, 2011 8:48 am, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: error while pdf image insertion
Could you put together the .tex source and all images together into a single .zip file and post them here? It's hard to diagnose without the actual files.
-
- Posts: 20
- Joined: Wed Dec 22, 2010 10:21 pm
Re: error while pdf image insertion
Individual image files are of 850KB. Is there a way, I can send those image PDF files? Please find the attached zip file with .tex and pdf generated file.
- Attachments
-
- sample.zip
- (82.22 KiB) Downloaded 177 times
error while pdf image insertion
When you wrote "because of minimum size allowed to upload" I thought the files were too small to be uploaded. Obviously you meant "maximum size allowed to upload"! How do one-page PDFs (presumably) get to be so big anyway? Personally, I'm not sure I'd trust opening a PDF like that -- why would it be so large for a single image?
Do you get the same problem with the .png file you uploaded earlier? Can you create fake PDFs using the same software you made those with, removing most of the content, but reproducing the same problem?
Otherwise I guess you could use a site like rapidshare and post the link here.
Do you get the same problem with the .png file you uploaded earlier? Can you create fake PDFs using the same software you made those with, removing most of the content, but reproducing the same problem?
Otherwise I guess you could use a site like rapidshare and post the link here.
-
- Posts: 20
- Joined: Wed Dec 22, 2010 10:21 pm
Re: error while pdf image insertion
I have uploaded sample.zip into radipshare. Please download from
http://rapidshare.com/files/440172920/sample.zip
http://rapidshare.com/files/440172920/sample.zip
error while pdf image insertion
Always pay attention to the warnings that LaTeX spits at you. In this case, the important ones are these:
The problem is that these PDFs use PDF version 1.6, but pdflatex can only handle 1.5 (and in fact, if your version of pdflatex is even a year old, it will only be able to handle version 1.4).
Sometimes you can solve this problem by setting the PDF version to higher number in your code:
But that often doesn't work, since the engine really isn't designed to handle features of PDF 1.6's, and I tried this in your case, and it didn't work. It looks like the "labels" on these graphs are a special comment field used only in PDF 1.6's that pdflatex can't handle.
So, your other option is to try to reduce the version numbers of the included PDFs. The software that created these PDFs should be taken out and shot; there is simply no excuse for these PDFs to be created the way they are, and to take up such a ridiculous amount of disk space. Obviously a Microsoft product. But do look to see if it has an option to output to a PDF with a lower version number instead.
If that software doesn't offer the option, then you can use Ghostscript to reduce the version numbers. Ghostscript's pdfwrite device driver uses 1.4 by default, I think. (Or mine does anyway.) I used the following command for the Linux version of ghostscript from the command line (Mac would be the same):
And similarly for edited2.pdf and edited3.pdf, and then deleted the originals and renamed the -output versions. And then things worked.
I think the command for the Windows version of ghostscript (used from a DOS prompt) is the same, but with "gswin32c.exe" at the beginning instead of "gs". You might need to put the whole path to the gswin32c.exe file in quotation marks there, e.g.:
but check the path to the gswin32c executable, since it'll be different depending on your version of Windows and version of Ghostscript. You'll need to try that for yourself, since I haven't verified it. (I don't use Windows. The day Microsoft makes a product that doesn't suck is the day they make a vacuum cleaner.)
(If you're a mac, the command should be the same as the Linux one.)
But it would be better just to get the original program to output PDFs with version 1.4 if possible.
Code: Select all
pdfTeX warning: pdflatex (file ./edited1.pdf): PDF inclusion: found PDF version
<1.6>, but at most version <1.5> allowed
<edited1.pdf, id=1, 166.25111pt x 124.69586pt>
File: edited1.pdf Graphic file (type pdf)
<use edited1.pdf>
pdfTeX warning: pdflatex (file ./edited2.pdf): PDF inclusion: found PDF version
<1.6>, but at most version <1.5> allowed
<edited2.pdf, id=2, 239.24382pt x 128.30937pt>
File: edited2.pdf Graphic file (type pdf)
<use edited2.pdf>
pdfTeX warning: pdflatex (file ./edited3.pdf): PDF inclusion: found PDF version
<1.6>, but at most version <1.5> allowed
<edited3.pdf, id=3, 235.63031pt x 130.47746pt>
File: edited3.pdf Graphic file (type pdf)
<use edited3.pdf>
Sometimes you can solve this problem by setting the PDF version to higher number in your code:
Code: Select all
\pdfminorversion=6
So, your other option is to try to reduce the version numbers of the included PDFs. The software that created these PDFs should be taken out and shot; there is simply no excuse for these PDFs to be created the way they are, and to take up such a ridiculous amount of disk space. Obviously a Microsoft product. But do look to see if it has an option to output to a PDF with a lower version number instead.
If that software doesn't offer the option, then you can use Ghostscript to reduce the version numbers. Ghostscript's pdfwrite device driver uses 1.4 by default, I think. (Or mine does anyway.) I used the following command for the Linux version of ghostscript from the command line (Mac would be the same):
Code: Select all
gs -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -o edited1-output.pdf edited1.pdf
I think the command for the Windows version of ghostscript (used from a DOS prompt) is the same, but with "gswin32c.exe" at the beginning instead of "gs". You might need to put the whole path to the gswin32c.exe file in quotation marks there, e.g.:
Code: Select all
"C:\Program Files (x86)\gs\gs9.00\bin\gswin32c.exe" -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -o edited1-output.pdf edited1.pdf
(If you're a mac, the command should be the same as the Linux one.)
But it would be better just to get the original program to output PDFs with version 1.4 if possible.
-
- Posts: 20
- Joined: Wed Dec 22, 2010 10:21 pm
Re: error while pdf image insertion
Thanks for your reply. I was able to shrink the size of pdf and your instructions was easy to follow. Ubuntu makes life easy. 
