We're working on converting large batches of text-based PDF documents into 
images and then back to PDF (partly to avoid font issues with certain print 
processes down the line). But we've come across an issue that's preventing us 
from moving forward.

Both with version 2.0.29 and 3.0.0, we can generate clean images with 
"PDFRenderer" and renderImageWithDPI() or similar methods. With RGB output, we 
get solid images but the size is larger than we'd like. So we try to use ARGB 
which creates a smaller / transparent background image except for 2 items we've 
found. Any form field with a transparent background and any embedded image have 
a non-transparent background. The images look clean and presumably are exactly 
what we need out of the render process.

But as soon as we try to convert the images back into a PDF by drawing the 
image to a blank document page, we end up with a border around all images and 
form fields that are non-transparent. I've included examples of both the raw 
images and the resulting PDF (as well as the source PDF). We've tried all kinds 
of things from render settings to draw settings and can't find a combination 
that changes this at all. We could address all of the form fields by removing 
backgrounds in our templates. However, we can't actually do anything to get rid 
of company logos or other images that need to appear in the documents.

Because we can't figure out how to get around this issue, we're unable to use 
ARGB and file sizes are too large to work with. If we can get ARGB to write to 
documents without the border, I think we can move forward. Any ideas on how or 
why this happens and whether there is a workaround or not?  If it matters, 
we're using Adobe Coldfusion to access java objects from a programming 
standpoint. But I'm pretty sure that's not a limiting factor. But I did notice 
that the built-in CF functions for working with PDF's do the same thing. So it 
may not have a workaround.

If there's another way to accomplish the same thing (ie end up with image-based 
pdf rather than text to avoid text interpretation issues), that would also be a 
possible solution. We can't embed fonts in the documents because the file sizes 
would then be too large to work with over the 1,000's of individual documents.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to