Convert PDF to JPG: some elements are lost

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
shroos
Posts: 2
Joined: 2020-01-14T07:01:06-07:00
Authentication code: 1152

Convert PDF to JPG: some elements are lost

Post by shroos »

Hi everybody!

It's my first post on this forum, so if i do any errors posting here, i apologize.

It could be a simple question for experienced IM devs but i couldn't find anything that helps me.

So i try to convert PDF file to JPG file by this way:

Code: Select all

convert -density 300 -colorspace rgb pdffile.pdf -alpha remove jpgfile.jpg
Simplified version:

Code: Select all

convert testw7.pdf -alpha remove page.jpg

It works well till i add some annotations to the PDF file.
When i try to convert the edited PDF file to JPG, there are no added annotations on the JPG image.
My test PDF file is W7 form - it's attached to this post.
I have added 3 annotations to this PDF: yellow, black and white squares.

Could anybody say what i'm doing wrong? What additional parameters do i need to use to make IM use PDF annotations for converting a new JPG file?
Is this even possible to convert PDF files with annotations to the JPG image?

https://drive.google.com/drive/folders/ ... sp=sharing
Here you could find my files:
- testw7.pdf - PDF with added annotations, which i try to convert to JPG;
- PDFannotations.png - screenshot of the PDF file with highlighted added PDF annotations;
- result.jpg - resulting JPG file after convertation.

I would be very appreciated for any help or any thoughts about my problem!

snibgo
Posts: 12556
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert PDF to JPG: some elements are lost

Post by snibgo »

IM delegates the rasterization of PDF to Ghostscript.

These annotations are pop-up notes. From https://stackoverflow.com/questions/152 ... hostscript :
Popup annotations are basically interactive, because you can open and close them, move them around etc, and Ghostscript doesn't support interactive elements.
snibgo's IM pages: im.snibgo.com

shroos
Posts: 2
Joined: 2020-01-14T07:01:06-07:00
Authentication code: 1152

Re: Convert PDF to JPG: some elements are lost

Post by shroos »

snibgo wrote:
2020-01-14T08:21:55-07:00
IM delegates the rasterization of PDF to Ghostscript.

These annotations are pop-up notes. From https://stackoverflow.com/questions/152 ... hostscript :
Popup annotations are basically interactive, because you can open and close them, move them around etc, and Ghostscript doesn't support interactive elements.
Thank you, snibgo!
Annotations in my PDF file are not a pop-up. These annotations are static and they are visible when i open PDF files in different PDF viewers or browsers. As i understood the posts on stackoverflow, people told about pop-up annotations.

snibgo
Posts: 12556
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert PDF to JPG: some elements are lost

Post by snibgo »

When I open your PDF in Adobe Acrobt Reader, I see three small rectangles. When I right-click on any of them, the menu has an option "Open Pop-Up Note".

I can open and close them, move them around, etc.
snibgo's IM pages: im.snibgo.com

Post Reply