Hi, I am new in FME - I need a help. I would like to convert an PDF file to JPEG.
converting PDF to JPEG
- August 23, 2018
- 18 replies
- 420 views
18 replies
- Evangelist
- 2020 replies
- August 23, 2018
Hi @tereziastredna
Just a question: your PDF file has image or text?
You can use the Reader PDF Geospatial or transformer to extract information PDF.
Could you share us your example data?
Thanks,
Danilo
- Evangelist
- 2020 replies
- August 23, 2018
Hi @tereziastredna
Just a question: your PDF file has image or text?
You can use the Reader PDF Geospatial or transformer to extract information PDF.
Could you share us your example data?
Thanks,
Danilo
- 98 replies
- August 23, 2018
Hi @tereziastredna
If you just want to make a JPEG image that looks exactly like your PDF, then you can use the "Non Spatial > Read Rasterized Pages" mode.
This will generate a feature type called "pdf_rasterized_pages", which will produce one raster per page. You can then send these features to a JPEG writer.
One interesting option is the "Raster Size > Mode". You can either use "Scale", like I did above, or you can make the rasters a custom size in pixels. I recommend trying a few different values for "Pixels per Point:", converting to JPEG, and seeing how the result looks. The bigger your "Pixels per Point" value, the larger your image will be.
PS. If you instead want to read JPEG images out of a PDF, rather than rendering the entire page, you want the "Spatial > Read Images" mode. I can tell you more about that mode if that is indeed what you're looking for.
- Author
- 59 replies
- August 24, 2018
Hello,
thanks to both of you.
My PDF file is a little bit of everything. Text, and images... see attached. test-pdf-to-jpeg.pdf
I tried to make it as you recommended jakemolnar, but I get an error. I am not sure what to change now. (to remove extra band) also attached error-fme.png
Thanks
- Celebrity
- 1824 replies
- August 24, 2018
Hello,
thanks to both of you.
My PDF file is a little bit of everything. Text, and images... see attached. test-pdf-to-jpeg.pdf
I tried to make it as you recommended jakemolnar, but I get an error. I am not sure what to change now. (to remove extra band) also attached error-fme.png
Thanks
The problem is because the PDF reader is generating an ALPHA band (which is used to control transparency). To remove it you can use a RasterInterpretationCoercer. Set the 'Destination Interpretation Type to 'RGB24'. Leave everything else default. You should then be able to write the image to JPEG.
- Author
- 59 replies
- August 24, 2018
The problem is because the PDF reader is generating an ALPHA band (which is used to control transparency). To remove it you can use a RasterInterpretationCoercer. Set the 'Destination Interpretation Type to 'RGB24'. Leave everything else default. You should then be able to write the image to JPEG.
- Celebrity
- 1824 replies
- August 24, 2018
- Celebrity
- 1824 replies
- August 24, 2018
If you add a RasterExpressionEvaluator and set it up like below this will set all the no data to white instead of black. Do this before you use the RasterInterpretationCoercer.

- Author
- 59 replies
- August 28, 2018
- Celebrity
- 1824 replies
- August 28, 2018
- Author
- 59 replies
- August 29, 2018
The problem is because the PDF reader is generating an ALPHA band (which is used to control transparency). To remove it you can use a RasterInterpretationCoercer. Set the 'Destination Interpretation Type to 'RGB24'. Leave everything else default. You should then be able to write the image to JPEG.
- Celebrity
- 1824 replies
- August 29, 2018
Oh dear. This is because the color bands must be in a mixed up order. I think the writer should work properly even if the bands are in the wrong order but the RasterExpressionEvaluator assumes the order is R>G>B>A. You may need to reorder the expression in the Elevator to match what comes into FME from the pdf reader. Alternatively you can use a RasterBandOrderer before the RasterExpressionEvaluator to order the bands in the standard way (RGBA). Perhaps @jakemolnar can see the order is gettign muddled by the pdf reader?
- Author
- 59 replies
- August 29, 2018
Oh dear. This is because the color bands must be in a mixed up order. I think the writer should work properly even if the bands are in the wrong order but the RasterExpressionEvaluator assumes the order is R>G>B>A. You may need to reorder the expression in the Elevator to match what comes into FME from the pdf reader. Alternatively you can use a RasterBandOrderer before the RasterExpressionEvaluator to order the bands in the standard way (RGBA). Perhaps @jakemolnar can see the order is gettign muddled by the pdf reader?
- Celebrity
- 1824 replies
- August 29, 2018
- Author
- 59 replies
- August 29, 2018
I have another problem :-(. I have a PDF files which consist of few pages (2-3). When I run the translation as recommended from you, the results are 2-3 sepatated files. I need to have them as an JPEG but as 1 file. I have no page numbers to set an attribute pdf_page_number. And what the worst is, I have a houndreds of this files. Some of them have only 1 page but some a few pages. So I need something what will also recognize what has more than 1 page. Do you have any idea how to join in together?
- Celebrity
- 1824 replies
- August 29, 2018
I have another problem :-(. I have a PDF files which consist of few pages (2-3). When I run the translation as recommended from you, the results are 2-3 sepatated files. I need to have them as an JPEG but as 1 file. I have no page numbers to set an attribute pdf_page_number. And what the worst is, I have a houndreds of this files. Some of them have only 1 page but some a few pages. So I need something what will also recognize what has more than 1 page. Do you have any idea how to join in together?
It's a fairly complex problem but if you ask give it a go and then ask a separate question when you get stuck I think you'll get some good help.
- 15 replies
- December 3, 2018
Hi @tereziastredna
If you just want to make a JPEG image that looks exactly like your PDF, then you can use the "Non Spatial > Read Rasterized Pages" mode.
This will generate a feature type called "pdf_rasterized_pages", which will produce one raster per page. You can then send these features to a JPEG writer.
One interesting option is the "Raster Size > Mode". You can either use "Scale", like I did above, or you can make the rasters a custom size in pixels. I recommend trying a few different values for "Pixels per Point:", converting to JPEG, and seeing how the result looks. The bigger your "Pixels per Point" value, the larger your image will be.
PS. If you instead want to read JPEG images out of a PDF, rather than rendering the entire page, you want the "Spatial > Read Images" mode. I can tell you more about that mode if that is indeed what you're looking for.
@tereziastredna
I have a similar problem. I am converting pdfs to tiffs and am getting both color changes and rotation changes. I was hoping this non-spatial option would solve things but nothing comes out of the reader.
I have also tried the suggestions in the previous answer with the RasterInterpretationCoercer but when I do that, the only change is that the image in the inspector changes to the same incorrect color (bluish) as the output. If I output to a jpeg, the color is wrong but the orientation is ok.
So I need to figure out both how to maintain the color and orientation of the original document.
- Safer
- 327 replies
- December 4, 2018
@tereziastredna
I have a similar problem. I am converting pdfs to tiffs and am getting both color changes and rotation changes. I was hoping this non-spatial option would solve things but nothing comes out of the reader.
I have also tried the suggestions in the previous answer with the RasterInterpretationCoercer but when I do that, the only change is that the image in the inspector changes to the same incorrect color (bluish) as the output. If I output to a jpeg, the color is wrong but the orientation is ok.
So I need to figure out both how to maintain the color and orientation of the original document.
Hi @justinv, I think it might be a good idea to post your issue as a new question. This thread is quite long already, so your new comment might not get noticed as easily. It would also help to add your sample data, workspace and log file to give some more background, so the community can provide suggestions based on your specific problem. Thank you!
Reply
Related Topics
Excel steps not working: "We're having trouble loading 'Worksheet' data. Unable to process request."icon
TroubleshootingMicrosoft Excel error: Unable to load choices. We're having trouble loading 'Worksheet' data.icon
TroubleshootingCreate Excel spreadsheet, column headers, and add row all at once?icon
How Do IHow to target an excel spreadsheet (to add a row to) with form dataicon
How Do ISlack error: Unable to load choices We're having trouble loading 'Channel' data. 504 Gateway timed out.icon
Troubleshooting
Helpful Members This Week
- liamfez
30 votes
- redgeographics
24 votes
- crutledge
20 votes
- philippeb
15 votes
- takashi
12 votes
- j.botterill
12 votes
- kailinatsafe
11 votes
- ebygomm
9 votes
- evieatsafe
8 votes
- nielsgerrits
8 votes
Recently Solved Questions
Having a problem with data type 'double' when fme is writing shapefiles
3 RepliesHow to display GroupID with SpatialSorter using FME Workbench 2024
2 RepliesCreate group ID based on conditions?
6 RepliesCan't merge wallls together in 3d buildings
2 RepliesPoint clouds - find the lowest height in clusters
6 Replies
Community Stats
- 30,985
- Posts
- 117,432
- Replies
- 38,764
- Members
Latest FME
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Scanning file for viruses.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
OKThis file cannot be downloaded
Sorry, our virus scanner detected that this file isn't safe to download.
OKCookie policy
We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.
Cookie settings
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.