convert command outputs file with poor quality

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
imageuser
Posts: 5
Joined: 2014-03-29T22:47:12-07:00
Authentication code: 6789

convert command outputs file with poor quality

Post by imageuser »

I am trying to attach another image to a .pdf file and the resulting output will be a .pdf file.

Running identify on the existing .pdf file gives the following message-
**** Warning: File has an invalid xref entry: 2. Rebuilding xref table.
**** Warning: stream operator not terminated by valid EOL.
**** Warning: stream operator not terminated by valid EOL.

**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.

**** Warning: File has an invalid xref entry: 2. Rebuilding xref table.
**** Warning: stream operator not terminated by valid EOL.
**** Warning: stream operator not terminated by valid EOL.

**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
I get the same message if I try to use 'convert' as mentioned below, to attach another image to this file to produce a new .pdf output file. I get an output file, however, it is of poor quality.
convert myjpg.jpg myoriginal.pdf myNewPdf.pdf
Is there a workaround to produce a .pdf file of reasonable quality from my original .pdf file so the document is readable?
The ImageMagick version I am using is 6.8.x
Thanks,
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert command outputs file with poor quality

Post by snibgo »

We need more information. Ideally, put your inputs somewhere like dropbox.com and paste the URLs here. Also give the exact IM command you are using.

What does "poor quality" mean?

PDF is a vector format. IM is a raster processor. So IM converts your PDF image to pixels, according to the density you provide, and puts those in a PDF wrapper. Density defaults to 72 dpi, which is usually too low for current PDFs.
snibgo's IM pages: im.snibgo.com
imageuser
Posts: 5
Joined: 2014-03-29T22:47:12-07:00
Authentication code: 6789

Re: convert command outputs file with poor quality

Post by imageuser »

Thank you for your response. The file that we have is production data and so we cannot share that data. By poor quality, I mean convert command generates a .pdf file, I can open it, however it is not very clear/readable.
I have used a simple convert command so far.
For example: convert myJpg.jpg myPdf.pdf myNewPdf.pdf (for attaching a .jpg file to my original .pdf file)
What are the possible options to try in such cases?
imageuser
Posts: 5
Joined: 2014-03-29T22:47:12-07:00
Authentication code: 6789

Re: convert command outputs file with poor quality

Post by imageuser »

We have tried converting the original .pdf as follows-
convert -density 250 myPdf.pdf myNewPdf.pdf, however, that does not seem to help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert command outputs file with poor quality

Post by fmw42 »

Do you have the same problem with all PDF files? If so, then provide some non-proprietary PDF that others can test and also post your "bad" resulting PDF from the conversion process. You can upload to dropbox.com (public folder) and then put links here to your images.

Without seeing what the exact issue is and what "bad" means, it is hard to know where to begin or what to suggest.

What is the source of the PDF files? When the input is displayed, does it look "good"? Is the PDF a pure vector file or does it contain a raster images?
imageuser
Posts: 5
Joined: 2014-03-29T22:47:12-07:00
Authentication code: 6789

Re: convert command outputs file with poor quality

Post by imageuser »

Thank you for your response. I was able to resolve this issue by converting each image file into a separate pdf and then by merging all pdfs into one pdf document.
Post Reply