Hi,
You posted a month ago... but your new file is a different one. In the
new file, there is Q = 1:
And Q = 1 means centered. Your old file didn't have that.
Code I used:
PDDocument doc = PDDocument.load(new File("line-up-classic.pdf"));
doc.getDocumentCatalog().getAcroForm().getField("Player
1").setValue("Test Text");
doc.save(new File("line-up-classic-saved.pdf"));
doc.close();
Tilman
PS: If you have follow-up questions, please don't wait a month.
Am 29.01.2020 um 08:37 schrieb Baskar Murugan:
Hi Team,
I've found some PDFs where if you just type in a value in PDF reader, it
will be left-aligned, but if we use pdfbox to set the value in the form,
the text is center-aligned.
I checked form field properties, It showing alignment as left
(formField.png)
Since we're not specifying any alignment information, I don't know why this
would be happening.
https://mail-archives.apache.org/mod_mbox/pdfbox-users/201912.mbox/browser
Thanks a lot for your help on this.
Hi team,
I've checked with my code but still it's show alignment issue.
I'm using JVM in lucee server.
I attached my PDF here.
https://drive.google.com/file/d/1g_pmbYucq-NBY6Cclw6qqh-pF2aae_M8/view?usp=sharing
Could you please send the java code which you tested with my PDF. It
would be very helpful to checking my implementation code to PDF box
jar.
I'm using latest pdf box jar pdfbox-app-2.0.18.jar
My java version is 1.8.0_241
Any help on this would be appreciated....