Paulo:

I can't use the code you sent me.  The PDFs I am reading in don't have ANY
bookmarks.  I need to read the PDF in, fill in the form fields and leave the
fields un-"flattened" and then create a brand new bookmark from scratch.

How is THIS done?

Thanks,

Jason

----- Original Message ----- 
From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "Jason Mosher - hotmail" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, June 07, 2004 9:12 AM
Subject: RE: [iText-questions] PdfStamper and CREATING NEW BOOKMARKS


That's explained in the SimpleBookmark javadoc. For example:

PdfReader reader = new PdfReader("TDA9800_CNV_4.pdf");
java.util.List bm = SimpleBookmark.getBookmark(reader);
SimpleBookmark.exportToXML(bm, new FileOutputStream("c:\\ic.xml"),
"UTF-8", false);
System.out.println(bm.toString());

will produce the xml:

<?xml version="1.0" encoding="UTF-8"?>
<Bookmark>
  <Title Action="GoTo" Page="2 Fit" >FEATURES</Title>
  <Title Action="GoTo" Page="2 Fit" >GENERAL DESCRIPTION</Title>
  <Title Action="GoTo" Page="2 Fit" >QUICK REFERENCE DATA</Title>
  <Title Action="GoTo" Page="2 Fit" >ORDERING INFORMATION</Title>
  <Title Action="GoTo" Page="4 Fit" >PINNING</Title>
  <Title Action="GoTo" Open="false" Page="5 Fit" >FUNCTIONAL DESCRIPTION
    <Title Action="GoTo" Page="5 Fit" >Vision IF input</Title>
    <Title Action="GoTo" Page="5 Fit" >IF and tuner AGC</Title>
    <Title Action="GoTo" Page="5 Fit" >Frequency detector, phase
detector and video demodulator</Title>
    <Title Action="GoTo" Page="5 Fit" >VCO and travelling wave
divider</Title>
    <Title Action="GoTo" Page="5 Fit" >Video amplifier, buffer and noise
clipping</Title>
    <Title Action="GoTo" Page="5 Fit" >Sound demodulation</Title>
  </Title>
  <Title Action="GoTo" Page="6 Fit" >LIMITING VALUES</Title>
  <Title Action="GoTo" Page="6 Fit" >THERMAL RESISTANCE</Title>
  <Title Action="GoTo" Page="7 Fit" >CHARACTERISTICS</Title>
  <Title Action="GoTo" Open="false" Page="20 Fit" >PACKAGE OUTLINES
    <Title Action="GoTo" Page="20 Fit" >SOT146-1</Title>
    <Title Action="GoTo" Page="21 Fit" >SOT163-1</Title>
  </Title>
  <Title Action="GoTo" Page="22 Fit" >SOLDERING</Title>
  <Title Action="GoTo" Page="23 Fit" >DEFINITIONS</Title>
  <Title Action="GoTo" Page="23 Fit" >LIFE SUPPORT APPLICATIONS</Title>
</Bookmark>

That corresponds to an internal List representation of:

[ {Action=GoTo, Title=FEATURES, Page=2 Fit},
  {Action=GoTo, Title=GENERAL DESCRIPTION, Page=2 Fit},
  {Action=GoTo, Title=QUICK REFERENCE DATA, Page=2 Fit},
  {Action=GoTo, Title=ORDERING INFORMATION, Page=2 Fit},
  {Action=GoTo, Title=PINNING, Page=4 Fit},
  {Action=GoTo, Title=FUNCTIONAL DESCRIPTION, Page=5 Fit, Open=false,
Kids=[
    {Action=GoTo, Title=Vision IF input, Page=5 Fit},
    {Action=GoTo, Title=IF and tuner AGC, Page=5 Fit},
    {Action=GoTo, Title=Frequency detector, phase detector and video
demodulator, Page=5 Fit},
    {Action=GoTo, Title=VCO and travelling wave divider, Page=5 Fit},
    {Action=GoTo, Title=Video amplifier, buffer and noise clipping,
Page=5 Fit},
    {Action=GoTo, Title=Sound demodulation, Page=5 Fit}]}
  {Action=GoTo, Title=LIMITING VALUES, Page=6 Fit},
  {Action=GoTo, Title=THERMAL RESISTANCE, Page=6 Fit},
  {Action=GoTo, Title=CHARACTERISTICS, Page=7 Fit},
  {Action=GoTo, Title=PACKAGE OUTLINES, Page=20 Fit, Open=false, Kids=[
    {Action=GoTo, Title=SOT146-1, Page=20 Fit},
    {Action=GoTo, Title=SOT163-1, Page=21 Fit}]},
  {Action=GoTo, Title=SOLDERING, Page=22 Fit},
  {Action=GoTo, Title=DEFINITIONS, Page=23 Fit},
  {Action=GoTo, Title=LIFE SUPPORT APPLICATIONS, Page=23 Fit}
]

Best Regards,
Paulo Soares


> -----Original Message-----
> From: Jason Mosher - hotmail [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 07, 2004 3:13 PM
> To: Paulo Soares; [EMAIL PROTECTED]
> Subject: Re: [iText-questions] PdfStamper and CREATING NEW BOOKMARKS
>
> Paulo:
>
> Thanks for the information.  I tried all weekend to pour through the
> documentation and examples I could find, but did not find an
> example of
> creating a NEW bookmark with SimpleBookmark.  Could you pass
> along a simple
> example?
>
> Thanks in advance,
>
> Jason
>
> ----- Original Message ----- 
> From: "Paulo Soares" <[EMAIL PROTECTED]>
> To: "Jason Mosher - hotmail" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Saturday, June 05, 2004 6:04 AM
> Subject: Re: [iText-questions] PdfStamper and CREATING NEW BOOKMARKS
>
>
> > You can create new bookmarks and modify the existing ones with
> > SimpleBookmark.
> >
> > Best Regards,
> > Paulo Soares
> >
> > ----- Original Message ----- 
> > From: "Jason Mosher - hotmail" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, June 04, 2004 22:58
> > Subject: [iText-questions] PdfStamper and CREATING NEW BOOKMARKS
> >
> >
> > Hi:
> >
> > I am using PdfStamper to form fill some existing files.  I
> then need to =
> > concatenate these files together.  My problem is this:
> >
> > I cannot find a way to create a NEW generated bookmark once
> the form is =
> > filled and add it to the resulting file.  It seems like I
> can either =
> > concatenate with bookmarks added, but the form values have been =
> > "flattened" OR I can keep the form filled variables "open"
> for further =
> > user edit (which is required) and not be able to create new
> bookmarks.
> >
> > Please help.  Thanks.
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by the new InstallShield X.
> > From Windows to Linux, servers to mobile, InstallShield X is the one
> > installation-authoring solution that does it all. Learn more and
> > evaluate today! http://www.installshield.com/Dev2Dev/0504
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
>


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to