Please provide the source pdf you used for rendering as well.

Thanks in advance
Andreas

Am 01.08.23 um 22:30 schrieb JJ Blodgett:
It looks like the attachments were stripped out of the email. I'll try to 
include Google doc links and hope these work:

Example of bad behavior: 
https://drive.google.com/file/d/1ZU-vvZ1uTTDM0LTRhDJPwqVX5nY2dBL_/view?usp=drive_link

ARGB render image: 
https://drive.google.com/file/d/1ZwyZejehc6AdiQJHxdJ5QrsvfJbgSq9S/view?usp=drive_link
RGB render image: 
https://drive.google.com/file/d/1m7Ikf1G65HoGJSHt9PLt6TVgT5qMhpMa/view?usp=drive_link

ARGB output PDF: 
https://drive.google.com/file/d/1kb-SHEE8xS2PYTWrAgfYgmuKJMF6YUql/view?usp=drive_link
RGB output PDF: 
https://drive.google.com/file/d/1PpHVEsSGcUltKZY0Gi-Kk1kLIx9XPLIW/view?usp=drive_link


________________________________
From: JJ Blodgett <jj.blodg...@silvervinesoftware.com>
Sent: Tuesday, August 1, 2023 11:49 AM
To: users@pdfbox.apache.org <users@pdfbox.apache.org>
Subject: Border / Box around images and form elements with backgrounds


EXTERNAL: Do not click links or open attachments if you do not recognize the 
sender.

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