[
https://issues.apache.org/jira/browse/PDFBOX-4209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466475#comment-16466475
]
Tilman Hausherr edited comment on PDFBOX-4209 at 5/7/18 9:34 PM:
-----------------------------------------------------------------
sorry Tilman, here is PDF and map values
{code:java}
PDDocument pdfDoc = PDDocument.load(new File("pdfbox_linux_issue.pdf"));
PDDocumentCatalog docCatalog = pdfDoc.getDocumentCatalog();
PDAcroForm acroForm = docCatalog.getAcroForm();
Map m = new HashMap();
m.put("amtPaidForUnit", "15,999.23");
m.put("amtPubFreightFees", "22.55");
m.put("amtPaidTotAccessories", "45612.12");
m.put("dealerDocPrepFees", "55.22");
m.put("amtDownTradeTotal", "56.89");
m.put("amtPaidSalesTax", "99.55");
m.put("amtSerContractTo", "895.66");
m.put("amtSerContractAmt", "965.36");
m.put("amtGapProtTo", "798.56");
m.put("amtGapProtAmt", "64654.33");
m.put("amtTireGuardTo", "45465.22");
m.put("amtTireGuardAmt", "455.66");
m.put("amtPaidOptExtWarr", "88.56");
m.put("amtPaidOptExtWarrAmt", "663.44");
m.put("amtPubTitleFees", "54.25");
m.put("amtPubLicFees", "4654.56");
m.put("amtPubRegFees", "545.13");
m.put("amtPubLienFees", "89.22");
m.put("amtPubFilingFees", "564.65");
m.put("amtPubStampFees", "56.65");
m.put("amtPubToAmt", "789.45");
m.put("amtPubTo2Amt", "15.645");
m.put("subtotalOfSectionsABC", "13.456");
m.put("amtLenderOrigFeesAmt", "64.454");
m.put("amtLender1FeesAmt", "63.56");
m.put("subtotalOfSection2", "89.12");
m.put("subtotalOfSection3", "63.45");
m.put("subtotalOfSection4", "89.15");
m.put("discAmtFinanced", "63.25");
for (Object fieldObj : acroForm.getFields())
{
PDField field = (PDField) fieldObj;
if (m.get(field.getFullyQualifiedName()) != null) // set value of
map when map key and pdf key is matched
{
field.setValue(m.get(field.getFullyQualifiedName()).toString());
}
}
pdfDoc.save(new File("pdfbox_linux_issue-saved.pdf"));
{code}
was (Author: anjib4):
sorry Tilman, here is PDF and map values
{code:java}
PDDocument pdfDoc = PDDocument.load(new File("123.pdf")); // put your pdf-file
location here
PDDocumentCatalog docCatalog = pdfDoc.getDocumentCatalog();
PDAcroForm acroForm = docCatalog.getAcroForm();
Map m = new HashMap();
m.put("amtPaidForUnit","15,999.23"); m.put("amtPubFreightFees","22.55");
m.put("amtPaidTotAccessories","45612.12"); m.put("dealerDocPrepFees","55.22");
m.put("amtDownTradeTotal","56.89"); m.put("amtPaidSalesTax","99.55");
m.put("amtSerContractTo","895.66"); m.put("amtSerContractAmt","965.36");
m.put("amtGapProtTo","798.56"); m.put("amtGapProtAmt","64654.33");
m.put("amtTireGuardTo","45465.22"); m.put("amtTireGuardAmt","455.66");
m.put("amtPaidOptExtWarr","88.56"); m.put("amtPaidOptExtWarrAmt","663.44");
m.put("amtPubTitleFees","54.25"); m.put("amtPubLicFees","4654.56");
m.put("amtPubRegFees","545.13"); m.put("amtPubLienFees","89.22");
m.put("amtPubFilingFees","564.65"); m.put("amtPubStampFees","56.65");
m.put("amtPubToAmt","789.45"); m.put("amtPubTo2Amt","15.645");
m.put("subtotalOfSectionsABC","13.456");
m.put("amtLenderOrigFeesAmt","64.454"); m.put("amtLender1FeesAmt","63.56");
m.put("subtotalOfSection2","89.12"); m.put("subtotalOfSection3","63.45");
m.put("subtotalOfSection4","89.15"); m.put("discAmtFinanced","63.25");
{{ for (Object fieldObj : acroForm.getFields()){ }}
{{PDField field = (PDField) fieldObj;
if(m.get(field.getFullyQualifiedName())!=null) // set value of map when map key
and pdf key is matched
field.setValue(m.get(field.getFullyQualifiedName()).toString()); }}
{{}}}
{code}
> PDFBox decimal value cuttingoff in LINUX OS
> -------------------------------------------
>
> Key: PDFBOX-4209
> URL: https://issues.apache.org/jira/browse/PDFBOX-4209
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm
> Affects Versions: 2.0.9
> Environment: LINUX
> Reporter: Anji Babu
> Priority: Major
> Attachments: pdfbox_issue.PNG, pdfbox_linux_issue.pdf
>
>
> Facing issue with Pdf decimal value mapping in the pdffiled in LINUX
> environment, right side decimal values are cutting off, appreciate quick help
> on this.
> {code:java}
> for (Object fieldObj : acroForm.getFields()){
> PDField field = (PDField) fieldObj;
> if(m.get(field.getFullyQualifiedName())!=null) // set value of map when map
> key and pdf key is matched
> field.setValue(m.get(field.getFullyQualifiedName()).toString());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]