pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajeev Menon <rajeevrmen...@gmail.com>
Subject Re: Help, values I load in from an FDF file into a PDF are not appearing using PDFbox inportFDF
Date Fri, 24 Oct 2014 16:48:34 GMT
Hi Maruan,

If we import the FDF file using the method that Pete mentioned above, can
we get around the long text not auto wrapping issue?

Is there any way to get the font name from the PDField?

I can see the fonts used in the PDF using the following code, but not able
to find what font each field is set to.

                Map<String,PDFont> pageFonts=page.getResources().getFonts();
                System.out.println("font
name:"+pageFonts.get("TT0").getFontDescriptor().getFontName());

Thanks,
Rajeev.

On Fri, Oct 24, 2014 at 12:26 PM, Maruan Sahyoun <sahyoun@fileaffairs.de>
wrote:

> when you click into the field are the values you set via the FDF file
> visible?
>
> BR
> Maruan
>
> Am 24.10.2014 um 16:52 schrieb Pete Nygaard <pnygaard@ritehite.com>:
>
> > I am trying to load field values into a PDF template using an FDF file.
> > however the values do not appear in the PDF that is saved to the file
> > system.
> > I can open the PDF and manually import the FDF file and the field values
> > populate so that tell me the FDF file is formatted correctly.
> >
> > The code is not generating any errors.  The PDF fields are empty when I
> > open the PDF document.
> >
> >
> >
> >                                File input = new File(flds[1]);
> >                                fdf = FDFDocument.load(input);
> >                                System.out.println("FDF file loaded");
> >
> >                                PDDocumentCatalog docCatalog = pd
> > .getDocumentCatalog();
> >                                PDAcroForm acroForm =
> > docCatalog.getAcroForm();
> >                                acroForm.setCacheFields( true );
> >                                acroForm.importFDF( fdf );
> >                                System.out.println("   FDF form imported"
> > );
> >
> >                                try {
> >                                  pd.save(PDFname);
> >                                  System.out.println("Saved file as: " +
> > PDFname);
> >                                  pd.close();
> >                                  System.out.println(
> > "--------------------------------");
> >                                } catch (COSVisitorException e) {
> >                                  e.printStackTrace();
> >                                }
> >
> >
> > Pete Nygaard
> > Sr, Programmer/Analyst
> > e-mail: pnygaard@ritehite.com
> >
> >
> >
> > CONFIDENTIALITY NOTICE: This message is from Rite-Hite Holding
> Corporation and may contain confidential and proprietary information that
> is intended only for the individual(s) or entities named. If you have
> received this message in error, please let us know immediately by e-mail
> reply and delete it from your system. You may not copy this message or
> disclose its contents to anyone. Rite-Hite reserves the right to monitor
> messages by authorized Rite-Hite employees at anytime and without further
> consent.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message