Don't you think it's worth validating the submitted content before the
comma, and perhaps inspecting the first few bytes of the "image data"
to ensure they comply with the header bytes required by the PNG or
JPEG spec?
I'm sure there would still be ways to mess with your code by feeding
it a malfo
I may run into this soon as well.
Do you think you'd be able to generate the font cache once, create a
one-off call to serve it back to yourself, and then package the font
cache files in with the app to prevent it from being regenerated every
time (and also avoid any S3 charges)?
Thanks,
Aa
Something in a zip cannot be a File. You can use getResourceAsStream
to get the contents of the PDF as an InputStream.
Thanks,
Aaron
On Thu, Apr 19, 2018 at 9:13 AM, shawn.oplin...@gmail.com
wrote:
>
> I need to load a static PDF document, from a java class, running in my J2EE
> web app
I have a PDF workflow where I take a base document with forms, then
append a footer that puts values in the form fields and save the
result, then open it with PDFBox and flatten it:
doc = PDDocument.load(tempFile);
doc.getDocumentCatalog().getAcroForm().flatten();
Then I add an image to the page
DFBox itself.
>
> Tilman
>
> Am 31.01.2019 um 02:52 schrieb Aaron Mulder:
> > I have a PDF workflow where I take a base document with forms, then
> > append a footer that puts values in the form fields and save the
> > result, then open it with PDFBox and flatten it:
, Feb 1, 2019 at 12:57 PM Tilman Hausherr wrote:
>
> Am 01.02.2019 um 14:50 schrieb Aaron Mulder:
> > Historically, I haven't been able to print from within Java because I
> > must be able to turn duplex on and off and specify a source paper tray
> > (one has paper, on
I am trying to fill out this PDF form programmatically with PDFBox 2:
https://www.shadowrunsixthworld.com/wp-content/uploads/SR6-Character-Sheet-Fillable.pdf
When I look at it with the PDF Debugger, I see different fields than if I
look at it using the PDFBox API. For instance:
PDF Debugger:
Pa
Is there an "easy" option to do a linear gradient fill that includes an
alpha component of the colors? Basically, I want to draw one shape with a
gradient fill over a different shape with a different color gradient fill
and use an alpha < 1 so that you can see the back shape through the front
one.
Is there a way to use the PrintPDF command-line tool and force it to use
duplex and a specific paper tray? These options are available via lpr (I'm
on a Mac). I have been printing PDFs via lpr but there's a new printer and
maybe 5% of jobs fail to print (the printer says "cancelling job" in the
m
LOG.info("Printed in " + ms + " ms");
> }
> finally
> {
> setCursor(Cursor.getDefaultCursor());
> }
> }
>
>
> Tilman
>
> On 11.03.2023 20:18, Aaron Mulder wrote:
> > Is there a way to use the PrintPDF command-line to
That's great, thanks!
On a side note, the issue printing PDFs directly to the printer was with a
Brother printer. For some fraction of PDFs, it just silently canceled the
job with no error message returned to the Mac that issued the job. This
never used to happen with the HP it replaced. It see
I'm using PDFBox to generate PDF documents.
I find that I need a few functions that are a bit higher-level than
PDF commands, yet not to the level of e.g. a report writer or
something. Things like drawing circles (or fourths of a circle),
fitting text into a rectangle by shrinking the font and/or
I see that the file that the font cache file is saved to a location
set by a system property.
I'm deploying my PDFBox app to OpenShift. The font cache directory
should be set to the value of an environment variable in that
environment (or some offset from the path in the env var). And, while
I c
ly better solution
than "keep your fingers crossed". Might be as good to just hardcode
the current OPENSHIFT_DATA_DIR into some class and have it e-mail me
if that doesn't match System.getenv("OPENSHIFT_DATA_DIR") so I know to
go update the system property.
Thanks,
A
If the form isn't changing, can you just check out the field
definition in the PDF doc? Here's one from the PDF form I'm working
with:
<< /Type /Annot /T (SlotsTotal 19) /V () /Rect [ 51.855 457.452 91.095 478.332
] /DV () /FT /Tx /DA (/Helvetica 12 Tf 0 g) /F 4 /MK 1972 0 R /Q 1 /Subtype
/Widget
So I've had an issue with a third-party PDF with forms where once I
complete the form the layout of the completed form field text is
slightly different in Preview on the Mac compared to Acrobat Reader on
Windows, and also across browsers with built-in pdf rendering. For
instance, the text might be
I am filling out a form on an existing PDF document. The base
document has /NeedAppearances true and the result is that the text
looks different on every viewer. For instance, on some the text is
offset vertically or the text is cut off when using a font that works
fine on a different viewer.
I
aruan Sahyoun wrote:
> Hi,
>
>> Am 24.07.2016 um 14:35 schrieb Aaron Mulder :
>>
>> I am filling out a form on an existing PDF document. The base
>> document has /NeedAppearances true and the result is that the text
>> looks different on every viewer. For instan
with no
compression.
Thanks,
Aaron
On Sun, Jul 24, 2016 at 10:34 AM, Maruan Sahyoun wrote:
> Hi Aaron,
>
>> Am 24.07.2016 um 16:24 schrieb Aaron Mulder :
>>
>> OK, thanks. The font is just the standard Helvetica so it should not
>> need to be embedded;
>
I hadn't (I guess, obviously) found the page describing the tools yet.
Thanks, both of you!
Aaron
On Sun, Jul 24, 2016 at 11:07 AM, Maruan Sahyoun wrote:
> Hi,
>
>> Am 24.07.2016 um 17:05 schrieb Aaron Mulder :
>>
>> Thank you again.
>>
>> I looked at Mu
ct as if the forms are empty.
I could combine #2 (if I bump out all the field Rects 2 points in each
direction to avoid the minuscule text) for non-Preview users and #3
for Preview users, except neither works with printing.
Thanks,
Aaron
On Sun, Jul 24, 2016 at 1:17 PM, Aaron Mulder wrot
I was poking around the code for string widths in PDFont.getStringWidth and etc.
It looks like to compute the width of a string it just adds up the
widths of each individual character in the string:
https://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDF
On Mon, Aug 1, 2016 at 2:23 PM, John Hewson wrote:
> That’s correct. getStringWidth is for use when creating new PDFs only, and we
> don’t
> implement kerning, so the width you get will be “correct” with respect to the
> text
> in the newly created PDF.
So, I guess I don't understand this part.
I'm having trouble emitting a copyright (C) or registered trademark
(R) sign in an appearance stream using the built-in Helvetica font.
Here's what I'm trying:
/Tx BMC
q
BT
/Helv 10 Tf
1 2.42 Td
12 TL
(\256\251This is a test) Tj
ET
Q
EMC
with /Helv defined as:
/Helv << /Type /Font /Subtype /Typ
manEncoding >>
Thanks,
Aaron
On Thu, Sep 1, 2016 at 11:08 AM, Aaron Mulder wrote:
> I'm having trouble emitting a copyright (C) or registered trademark
> (R) sign in an appearance stream using the built-in Helvetica font.
>
> Here's what I'm trying:
>
>
Right now I have an "original" PDF document with blank form fields.
I've appended to the end a document revision that includes a set of
overrides to specify values for those form fields. However, for a
variety of reasons I've ended up specifying appearance streams and
setting /NeedAppearances tru
THANK YOU!
I'm going to production with a PDF app this weekend, and discovered this
morning that PDFBox got an NPE loading certain documents.
Caused by: java.lang.NullPointerException
at
org.apache.pdfbox.pdmodel.PDPageContentStream.(PDPageContentStream.java:198)
at
org.apache.pdfbox.pdmodel.PDPa
OK this is a long shot but... have a look at this PDF:
https://media.dndbeyond.com/compendium-images/phb/downloads/DnD_2024_Character-Sheet.pdf
It's 16 MB. Eyeballing the thing, it doesn't seem like there's that much
complexity in there, though it does have a lot of background images or
textures
se tell when you got it, so I can delete it.
>
> Tilman
>
> On 20.01.2025 18:10, Aaron Mulder wrote:
> > Thank you! I guess I'm too inexperienced with PDFDebugger -- I didn't
> find
> > that page background.
> >
> > So my next question is, is there a way to
/Intent/RelativeColorimetric/*Length
> 5509296*/Name/X/Subtype/Image/Type/XObject/Width 2448>>stream
>
> So you have 3 large images in total. I didn't bother researching where
> they are, your PDF is very nested. I suspect that these are more
> backgrounds,
30 matches
Mail list logo