I continue to have trouble converting PDFs to JPGs! I am/have been followed the instruction on:
but keep getting errors on the Writer.
JPEG writer: This format cannot support more than 3 bands. Please remove the extra bands and try again JPEG writer: An error has occurred. Check the logfile above for details
How do I find out the number of Bands as they pertain to ImageRasterizer’s Raster Properties Number of Columns and Number of Rows?? Or is there another way??
Thx
Brian
Page 1 / 1
Hello @klingdom,
Based on the error you’re seeing, the rasterized output from the PDF reader is RGBA32, which the JPEG writer cannot handle as this format does not support alpha bands.
Use a RasterInterpretationCoercer and set the Destination Interpretation Type parameter to “RGB24”, and choose to either apply or drop the alpha band in the RGBA to RGB parameter.
I hope this helps.
Hello @klingdom,
Based on the error you’re seeing, the rasterized output from the PDF reader is RGBA32, which the JPEG writer cannot handle as this format does not support alpha bands.
Use a RasterInterpretationCoercer and set the Destination Interpretation Type parameter to “RGB24”, and choose to either apply or drop the alpha band in the RGBA to RGB parameter.
I hope this helps.
Great @debbiatsafe
debbiatsafe,
I tried your instruction and many gyrations, but still getting Errors @ReinterpretRaster: Failed to obtain raster from feature. Only features with raster geometry are expected.
Is there a GEOMETRY_TYPE that needs to be expose?
I’m pretty sure these are PDF exports from A-CAD. I attached a zip of the log and PDF
Thx
Brian
Hi @klingdom
Based on the error in the log, you are attempting to send vector features into the RasterInterpretationCoercer transformer. Rasterized pages are output from the pdf_rasterized_pages feature type while vector features are output from the pdf_no_layer feature type.
Re-add a PDF reader that has the Read Rasterized Page parameter enabled (in Non-Spatial section) and connect pdf_rasterized_pages feature type to the RasterInterpretationCoercer.
The PDF file you sent has a rotation applied so you may need to rotate the raster before writing to JPEG. Alternatively, you can also generate a world file in the JPEG writer to auto-apply the rotation. The output JPEG file will then appear in the expected page orientation.
Thx very much for all your help! I have now got the transformation to run without errors. How can I flip the background and foreground to black lines on white?
Is there any reading and training on this?
Thx
Brian
Hi @klingdom,
Change the RasterInterpretationCoercer’s RGBA to RGB parameter from the default “Drop alpha band” value to “Apply alpha band” for a white background.