You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Anil Pinto <ap...@lobotec.com> on 2008/09/11 02:30:26 UTC

FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Hello,

I am in the process of evaluating iText for it's watermark capabilities on PDF.

I have been using FOP 0.95 since it's release for PDF creation. I have used previous versions of FOP but not with iText (2.1.3).

I was able to get the watermark to appear without problems when running iText on a PDF created by FOP 0.95 from the command prompt. When I tried the same from a PDF created using a standalone Java problem that used the API FOP  I encountered the error 

Exception in thread "main" ExceptionConverter: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
        at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
        at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
        at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
        at temp.ITextTest.watermark(ITextTest.java:200)
        at temp.ITextTest.applyWaterMark(ITextTest.java:128)
        at temp.ITextTest.main(ITextTest.java:218)

I initially thought it was something to do with (maybe) different parser references in the classpath. But was then able to replicate the problem with the same jars on the classpath.

I am using JDK 1.5.0_06 with the necessary jars provided by fop.

The cause of the problem seemed to be when I used the user configuration reference to configure the fop. I was able to recreate the problem from the command line now while referencing the configuration file (fop.xconf). Without the config file iText gladly adds the watermark text.

On comparing the 2 pdfs in a comparison tool, I saw the following code/tags in the pdf that works (no config reference) that did not exist in the pdf that did not work (referenced config).

stream
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>

<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
<pdf:PDFVersion>1.4</pdf:PDFVersion>
<pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
</rdf:Description>
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
<xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
</rdf:Description>
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
<dc:date>
<rdf:Seq>
<rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
</rdf:Seq>
</dc:date>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="r"?>
endstream

On overwriting this information to the other PDF (overwriting binary contents between stream and endstream), iText stops complaining and creates the watermark.


I am not sure why the configuration file reference is introducing some content that iText does not like, but I need to reference the configuration file. 

Any help towards getting this problem resolved is greatly appreciated.

Thanks,
Anil Pinto.

RE: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Anil Pinto <ap...@lobotec.com>.
Thanks Jeremias, that helps me understand the effects of the change. I will
go ahead with it.


-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
Sent: Thursday, September 11, 2008 11:32 PM
To: fop-users@xmlgraphics.apache.org
Cc: apinto@lobotec.com
Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
allowed prolog" when referencing the FOP configuration file


I'm glad I could help. Removing the filterList resets the various
filters to their defaults which are well chosen. XMP streams won't be
compressed in this case. The filterList is essentially there for FOP
developers so we can disable compression when we debug PDF output.
Advanced users can tweak PDF generation (add base64 encoding and such)
if they know what they do. Normal users shouldn't need to care about
that.

On 11.09.2008 22:20:44 Anil Pinto wrote:
> Jeremias,
>
> It worked !! Thank you very much.
>
> Just curious, removing the  <filterList> element in it's entirety should
not
> cause any noticeable effects to the PDF creation process and other user
> configuration settings, right ? My ignorance wrt XMP is just forcing me to
> verify the effect of the change.
>
> For what it's worth, I am glad that the fix was quite simple :-)
>
> Thank you,
> Anil Pinto.
>
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Thursday, September 11, 2008 12:58 PM
> To: fop-users@xmlgraphics.apache.org
> Cc: apinto@lobotec.com
> Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
> allowed prolog" when referencing the FOP configuration file
>
>
> Hmm, I guess I'll have to take a closer look at this when I have more
> time. I seems that
>
>       <filterList>
>         <!-- provides compression using zlib flate (default is on) -->
>         <value>flate</value>
>
>         <!-- encodes binary data into printable ascii characters (default
> off)
>              This provides about a 4:5 expansion of data size -->
>         <!-- <value>ascii-85</value> -->
>
>         <!-- encodes binary data with hex representation (default off)
>              This filter is not recommended as it doubles the data
size -->
>         <!-- <value>ascii-hex</value> -->
>       </filterList>
>
> also activates the "flate" filter for the XMP stream but that stream
> must never be compressed. Anil, please just remove the entire
> "filterList" element from the configuration file. After that it should
> all work. The defaults will still make sure that the PDF is compressed.
>
> HTH
>
> On 11.09.2008 21:12:51 Anil Pinto wrote:
> > Jeremias,
> >
> > Here are the PDF files and other resources in a .zip that I hope shed
> light on the situation.
> >
> > The image file is a snapshot of the diff tool showing the section that I
> mentioned in my previous email. Note that when I copy the contents of the
> left and overwrite the contents on the right and save the PDF, the water
> mark is now created by iText without complains.
> >
> > Hope this help and I really appreciate you taking the time to help
further
> investigate this problem. Let me know if there is any more information you
> would like.
> >
> > Thanks,
> > Anil Pinto.
> >
> > -----Original Message-----
> > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > Sent: Thursday, September 11, 2008 2:49 AM
> > To: fop-users@xmlgraphics.apache.org
> > Cc: apinto@lobotec.com
> > Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
> > allowed prolog" when referencing the FOP configuration file
> >
> >
> > When I implemented XMP functionality I've verified it with various
tools.
> > The stacktrace shows that iText has a problem parsing the XMP packet in
> > the PDF. I'd ask the iText people first why they can't parse the XMP
> > packet. Maybe there's something wrong with their setting up of the XML
> > parser for the metadata stream. Without access to the two PDFs you
> > produced I have no idea why it works one time but not the other.
> >
> > If you can open the PDF in Acrobat Reader and look at the metadata
> > ("Additional Metadata..." button) then iText probably needs to improve
> > their code.
> >
> > On 11.09.2008 02:30:26 Anil Pinto wrote:
> > > Hello,
> > >
> > > I am in the process of evaluating iText for it's watermark
capabilities
> on PDF.
> > >
> > > I have been using FOP 0.95 since it's release for PDF creation. I have
> used previous versions of FOP but not with iText (2.1.3).
> > >
> > > I was able to get the watermark to appear without problems when
running
> iText on a PDF created by FOP 0.95 from the command prompt. When I tried
the
> same from a PDF created using a standalone Java problem that used the API
> FOP  I encountered the error
> > >
> > > Exception in thread "main" ExceptionConverter:
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> > >         at
>
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:26
> 4)
> > >         at
>
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBu
> ilderImpl.java:292)
> > >         at
> javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
> > >         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
> > >         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
> > >         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
> > >         at temp.ITextTest.watermark(ITextTest.java:200)
> > >         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
> > >         at temp.ITextTest.main(ITextTest.java:218)
> > >
> > > I initially thought it was something to do with (maybe) different
parser
> references in the classpath. But was then able to replicate the problem
with
> the same jars on the classpath.
> > >
> > > I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> > >
> > > The cause of the problem seemed to be when I used the user
configuration
> reference to configure the fop. I was able to recreate the problem from
the
> command line now while referencing the configuration file (fop.xconf).
> Without the config file iText gladly adds the watermark text.
> > >
> > > On comparing the 2 pdfs in a comparison tool, I saw the following
> code/tags in the pdf that works (no config reference) that did not exist
in
> the pdf that did not work (referenced config).
> > >
> > > stream
> > > <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> > >
> > > <x:xmpmeta xmlns:x="adobe:ns:meta/">
> > > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> > > <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
rdf:about="">
> > > <pdf:PDFVersion>1.4</pdf:PDFVersion>
> > > <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> > > </rdf:Description>
> > > <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/"
rdf:about="">
> > > <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> > > </rdf:Description>
> > > <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"
> rdf:about="">
> > > <dc:date>
> > > <rdf:Seq>
> > > <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> > > </rdf:Seq>
> > > </dc:date>
> > > </rdf:Description>
> > > </rdf:RDF>
> > > </x:xmpmeta>
> > > <?xpacket end="r"?>
> > > endstream
> > >
> > > On overwriting this information to the other PDF (overwriting binary
> contents between stream and endstream), iText stops complaining and
creates
> the watermark.
> > >
> > >
> > > I am not sure why the configuration file reference is introducing some
> content that iText does not like, but I need to reference the
configuration
> file.
> > >
> > > Any help towards getting this problem resolved is greatly appreciated.
> > >
> > > Thanks,
> > > Anil Pinto.
> >
> >
> >
> >
> > Jeremias Maerki
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
>
> Jeremias Maerki
>
>



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I'm glad I could help. Removing the filterList resets the various
filters to their defaults which are well chosen. XMP streams won't be
compressed in this case. The filterList is essentially there for FOP
developers so we can disable compression when we debug PDF output.
Advanced users can tweak PDF generation (add base64 encoding and such)
if they know what they do. Normal users shouldn't need to care about
that.

On 11.09.2008 22:20:44 Anil Pinto wrote:
> Jeremias,
> 
> It worked !! Thank you very much.
> 
> Just curious, removing the  <filterList> element in it's entirety should not
> cause any noticeable effects to the PDF creation process and other user
> configuration settings, right ? My ignorance wrt XMP is just forcing me to
> verify the effect of the change.
> 
> For what it's worth, I am glad that the fix was quite simple :-)
> 
> Thank you,
> Anil Pinto.
> 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Thursday, September 11, 2008 12:58 PM
> To: fop-users@xmlgraphics.apache.org
> Cc: apinto@lobotec.com
> Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
> allowed prolog" when referencing the FOP configuration file
> 
> 
> Hmm, I guess I'll have to take a closer look at this when I have more
> time. I seems that
> 
>       <filterList>
>         <!-- provides compression using zlib flate (default is on) -->
>         <value>flate</value>
> 
>         <!-- encodes binary data into printable ascii characters (default
> off)
>              This provides about a 4:5 expansion of data size -->
>         <!-- <value>ascii-85</value> -->
> 
>         <!-- encodes binary data with hex representation (default off)
>              This filter is not recommended as it doubles the data size -->
>         <!-- <value>ascii-hex</value> -->
>       </filterList>
> 
> also activates the "flate" filter for the XMP stream but that stream
> must never be compressed. Anil, please just remove the entire
> "filterList" element from the configuration file. After that it should
> all work. The defaults will still make sure that the PDF is compressed.
> 
> HTH
> 
> On 11.09.2008 21:12:51 Anil Pinto wrote:
> > Jeremias,
> >
> > Here are the PDF files and other resources in a .zip that I hope shed
> light on the situation.
> >
> > The image file is a snapshot of the diff tool showing the section that I
> mentioned in my previous email. Note that when I copy the contents of the
> left and overwrite the contents on the right and save the PDF, the water
> mark is now created by iText without complains.
> >
> > Hope this help and I really appreciate you taking the time to help further
> investigate this problem. Let me know if there is any more information you
> would like.
> >
> > Thanks,
> > Anil Pinto.
> >
> > -----Original Message-----
> > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > Sent: Thursday, September 11, 2008 2:49 AM
> > To: fop-users@xmlgraphics.apache.org
> > Cc: apinto@lobotec.com
> > Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
> > allowed prolog" when referencing the FOP configuration file
> >
> >
> > When I implemented XMP functionality I've verified it with various tools.
> > The stacktrace shows that iText has a problem parsing the XMP packet in
> > the PDF. I'd ask the iText people first why they can't parse the XMP
> > packet. Maybe there's something wrong with their setting up of the XML
> > parser for the metadata stream. Without access to the two PDFs you
> > produced I have no idea why it works one time but not the other.
> >
> > If you can open the PDF in Acrobat Reader and look at the metadata
> > ("Additional Metadata..." button) then iText probably needs to improve
> > their code.
> >
> > On 11.09.2008 02:30:26 Anil Pinto wrote:
> > > Hello,
> > >
> > > I am in the process of evaluating iText for it's watermark capabilities
> on PDF.
> > >
> > > I have been using FOP 0.95 since it's release for PDF creation. I have
> used previous versions of FOP but not with iText (2.1.3).
> > >
> > > I was able to get the watermark to appear without problems when running
> iText on a PDF created by FOP 0.95 from the command prompt. When I tried the
> same from a PDF created using a standalone Java problem that used the API
> FOP  I encountered the error
> > >
> > > Exception in thread "main" ExceptionConverter:
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> > >         at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:26
> 4)
> > >         at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBu
> ilderImpl.java:292)
> > >         at
> javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
> > >         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
> > >         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
> > >         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
> > >         at temp.ITextTest.watermark(ITextTest.java:200)
> > >         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
> > >         at temp.ITextTest.main(ITextTest.java:218)
> > >
> > > I initially thought it was something to do with (maybe) different parser
> references in the classpath. But was then able to replicate the problem with
> the same jars on the classpath.
> > >
> > > I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> > >
> > > The cause of the problem seemed to be when I used the user configuration
> reference to configure the fop. I was able to recreate the problem from the
> command line now while referencing the configuration file (fop.xconf).
> Without the config file iText gladly adds the watermark text.
> > >
> > > On comparing the 2 pdfs in a comparison tool, I saw the following
> code/tags in the pdf that works (no config reference) that did not exist in
> the pdf that did not work (referenced config).
> > >
> > > stream
> > > <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> > >
> > > <x:xmpmeta xmlns:x="adobe:ns:meta/">
> > > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> > > <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
> > > <pdf:PDFVersion>1.4</pdf:PDFVersion>
> > > <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> > > </rdf:Description>
> > > <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
> > > <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> > > </rdf:Description>
> > > <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"
> rdf:about="">
> > > <dc:date>
> > > <rdf:Seq>
> > > <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> > > </rdf:Seq>
> > > </dc:date>
> > > </rdf:Description>
> > > </rdf:RDF>
> > > </x:xmpmeta>
> > > <?xpacket end="r"?>
> > > endstream
> > >
> > > On overwriting this information to the other PDF (overwriting binary
> contents between stream and endstream), iText stops complaining and creates
> the watermark.
> > >
> > >
> > > I am not sure why the configuration file reference is introducing some
> content that iText does not like, but I need to reference the configuration
> file.
> > >
> > > Any help towards getting this problem resolved is greatly appreciated.
> > >
> > > Thanks,
> > > Anil Pinto.
> >
> >
> >
> >
> > Jeremias Maerki
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 
> 
> Jeremias Maerki
> 
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
It is corrected now in FOP Trunk:
http://svn.apache.org/viewvc?rev=695491&view=rev

On 12.09.2008 13:53:03 Mathias Brossard wrote:
> Jeremias Maerki wrote:
> > Hmm, I guess I'll have to take a closer look at this when I have more
> > time. I seems that 
> > 
> >       <filterList>
> >         <!-- provides compression using zlib flate (default is on) -->
> >         <value>flate</value>
> >   
> >         <!-- encodes binary data into printable ascii characters (default off)
> >              This provides about a 4:5 expansion of data size -->
> >         <!-- <value>ascii-85</value> -->
> >   
> >         <!-- encodes binary data with hex representation (default off)
> >              This filter is not recommended as it doubles the data size -->
> >         <!-- <value>ascii-hex</value> -->
> >       </filterList>
> > 
> > also activates the "flate" filter for the XMP stream but that stream
> > must never be compressed. Anil, please just remove the entire
> > "filterList" element from the configuration file. After that it should
> > all work. The defaults will still make sure that the PDF is compressed.
> 
> 	I'm wondering if you intend to correct the "XMP stream getting through the
> flate filter" issue. The configuration fragment above is part of the standard
> fop distribution.
> 
> Sincerely,
> -- 
> Mathias Brossard




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Mathias Brossard <ma...@opentrust.com>.
Jeremias Maerki wrote:
> Hmm, I guess I'll have to take a closer look at this when I have more
> time. I seems that 
> 
>       <filterList>
>         <!-- provides compression using zlib flate (default is on) -->
>         <value>flate</value>
>   
>         <!-- encodes binary data into printable ascii characters (default off)
>              This provides about a 4:5 expansion of data size -->
>         <!-- <value>ascii-85</value> -->
>   
>         <!-- encodes binary data with hex representation (default off)
>              This filter is not recommended as it doubles the data size -->
>         <!-- <value>ascii-hex</value> -->
>       </filterList>
> 
> also activates the "flate" filter for the XMP stream but that stream
> must never be compressed. Anil, please just remove the entire
> "filterList" element from the configuration file. After that it should
> all work. The defaults will still make sure that the PDF is compressed.

	I'm wondering if you intend to correct the "XMP stream getting through the
flate filter" issue. The configuration fragment above is part of the standard
fop distribution.

Sincerely,
-- 
Mathias Brossard

RE: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Anil Pinto <ap...@lobotec.com>.
Jeremias,

It worked !! Thank you very much.

Just curious, removing the  <filterList> element in it's entirety should not
cause any noticeable effects to the PDF creation process and other user
configuration settings, right ? My ignorance wrt XMP is just forcing me to
verify the effect of the change.

For what it's worth, I am glad that the fix was quite simple :-)

Thank you,
Anil Pinto.

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
Sent: Thursday, September 11, 2008 12:58 PM
To: fop-users@xmlgraphics.apache.org
Cc: apinto@lobotec.com
Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
allowed prolog" when referencing the FOP configuration file


Hmm, I guess I'll have to take a closer look at this when I have more
time. I seems that

      <filterList>
        <!-- provides compression using zlib flate (default is on) -->
        <value>flate</value>

        <!-- encodes binary data into printable ascii characters (default
off)
             This provides about a 4:5 expansion of data size -->
        <!-- <value>ascii-85</value> -->

        <!-- encodes binary data with hex representation (default off)
             This filter is not recommended as it doubles the data size -->
        <!-- <value>ascii-hex</value> -->
      </filterList>

also activates the "flate" filter for the XMP stream but that stream
must never be compressed. Anil, please just remove the entire
"filterList" element from the configuration file. After that it should
all work. The defaults will still make sure that the PDF is compressed.

HTH

On 11.09.2008 21:12:51 Anil Pinto wrote:
> Jeremias,
>
> Here are the PDF files and other resources in a .zip that I hope shed
light on the situation.
>
> The image file is a snapshot of the diff tool showing the section that I
mentioned in my previous email. Note that when I copy the contents of the
left and overwrite the contents on the right and save the PDF, the water
mark is now created by iText without complains.
>
> Hope this help and I really appreciate you taking the time to help further
investigate this problem. Let me know if there is any more information you
would like.
>
> Thanks,
> Anil Pinto.
>
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Thursday, September 11, 2008 2:49 AM
> To: fop-users@xmlgraphics.apache.org
> Cc: apinto@lobotec.com
> Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
> allowed prolog" when referencing the FOP configuration file
>
>
> When I implemented XMP functionality I've verified it with various tools.
> The stacktrace shows that iText has a problem parsing the XMP packet in
> the PDF. I'd ask the iText people first why they can't parse the XMP
> packet. Maybe there's something wrong with their setting up of the XML
> parser for the metadata stream. Without access to the two PDFs you
> produced I have no idea why it works one time but not the other.
>
> If you can open the PDF in Acrobat Reader and look at the metadata
> ("Additional Metadata..." button) then iText probably needs to improve
> their code.
>
> On 11.09.2008 02:30:26 Anil Pinto wrote:
> > Hello,
> >
> > I am in the process of evaluating iText for it's watermark capabilities
on PDF.
> >
> > I have been using FOP 0.95 since it's release for PDF creation. I have
used previous versions of FOP but not with iText (2.1.3).
> >
> > I was able to get the watermark to appear without problems when running
iText on a PDF created by FOP 0.95 from the command prompt. When I tried the
same from a PDF created using a standalone Java problem that used the API
FOP  I encountered the error
> >
> > Exception in thread "main" ExceptionConverter:
org.xml.sax.SAXParseException: Content is not allowed in prolog.
> >         at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:26
4)
> >         at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBu
ilderImpl.java:292)
> >         at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
> >         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
> >         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
> >         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
> >         at temp.ITextTest.watermark(ITextTest.java:200)
> >         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
> >         at temp.ITextTest.main(ITextTest.java:218)
> >
> > I initially thought it was something to do with (maybe) different parser
references in the classpath. But was then able to replicate the problem with
the same jars on the classpath.
> >
> > I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> >
> > The cause of the problem seemed to be when I used the user configuration
reference to configure the fop. I was able to recreate the problem from the
command line now while referencing the configuration file (fop.xconf).
Without the config file iText gladly adds the watermark text.
> >
> > On comparing the 2 pdfs in a comparison tool, I saw the following
code/tags in the pdf that works (no config reference) that did not exist in
the pdf that did not work (referenced config).
> >
> > stream
> > <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> >
> > <x:xmpmeta xmlns:x="adobe:ns:meta/">
> > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> > <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
> > <pdf:PDFVersion>1.4</pdf:PDFVersion>
> > <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> > </rdf:Description>
> > <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
> > <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> > </rdf:Description>
> > <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"
rdf:about="">
> > <dc:date>
> > <rdf:Seq>
> > <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> > </rdf:Seq>
> > </dc:date>
> > </rdf:Description>
> > </rdf:RDF>
> > </x:xmpmeta>
> > <?xpacket end="r"?>
> > endstream
> >
> > On overwriting this information to the other PDF (overwriting binary
contents between stream and endstream), iText stops complaining and creates
the watermark.
> >
> >
> > I am not sure why the configuration file reference is introducing some
content that iText does not like, but I need to reference the configuration
file.
> >
> > Any help towards getting this problem resolved is greatly appreciated.
> >
> > Thanks,
> > Anil Pinto.
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hmm, I guess I'll have to take a closer look at this when I have more
time. I seems that 

      <filterList>
        <!-- provides compression using zlib flate (default is on) -->
        <value>flate</value>
  
        <!-- encodes binary data into printable ascii characters (default off)
             This provides about a 4:5 expansion of data size -->
        <!-- <value>ascii-85</value> -->
  
        <!-- encodes binary data with hex representation (default off)
             This filter is not recommended as it doubles the data size -->
        <!-- <value>ascii-hex</value> -->
      </filterList>

also activates the "flate" filter for the XMP stream but that stream
must never be compressed. Anil, please just remove the entire
"filterList" element from the configuration file. After that it should
all work. The defaults will still make sure that the PDF is compressed.

HTH

On 11.09.2008 21:12:51 Anil Pinto wrote:
> Jeremias,
> 
> Here are the PDF files and other resources in a .zip that I hope shed light on the situation.
> 
> The image file is a snapshot of the diff tool showing the section that I mentioned in my previous email. Note that when I copy the contents of the left and overwrite the contents on the right and save the PDF, the water mark is now created by iText without complains.
> 
> Hope this help and I really appreciate you taking the time to help further investigate this problem. Let me know if there is any more information you would like.
> 
> Thanks,
> Anil Pinto.
> 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Thursday, September 11, 2008 2:49 AM
> To: fop-users@xmlgraphics.apache.org
> Cc: apinto@lobotec.com
> Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
> allowed prolog" when referencing the FOP configuration file
> 
> 
> When I implemented XMP functionality I've verified it with various tools.
> The stacktrace shows that iText has a problem parsing the XMP packet in
> the PDF. I'd ask the iText people first why they can't parse the XMP
> packet. Maybe there's something wrong with their setting up of the XML
> parser for the metadata stream. Without access to the two PDFs you
> produced I have no idea why it works one time but not the other.
> 
> If you can open the PDF in Acrobat Reader and look at the metadata
> ("Additional Metadata..." button) then iText probably needs to improve
> their code.
> 
> On 11.09.2008 02:30:26 Anil Pinto wrote:
> > Hello,
> > 
> > I am in the process of evaluating iText for it's watermark capabilities on PDF.
> > 
> > I have been using FOP 0.95 since it's release for PDF creation. I have used previous versions of FOP but not with iText (2.1.3).
> > 
> > I was able to get the watermark to appear without problems when running iText on a PDF created by FOP 0.95 from the command prompt. When I tried the same from a PDF created using a standalone Java problem that used the API FOP  I encountered the error 
> > 
> > Exception in thread "main" ExceptionConverter: org.xml.sax.SAXParseException: Content is not allowed in prolog.
> >         at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
> >         at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
> >         at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
> >         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
> >         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
> >         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
> >         at temp.ITextTest.watermark(ITextTest.java:200)
> >         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
> >         at temp.ITextTest.main(ITextTest.java:218)
> > 
> > I initially thought it was something to do with (maybe) different parser references in the classpath. But was then able to replicate the problem with the same jars on the classpath.
> > 
> > I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> > 
> > The cause of the problem seemed to be when I used the user configuration reference to configure the fop. I was able to recreate the problem from the command line now while referencing the configuration file (fop.xconf). Without the config file iText gladly adds the watermark text.
> > 
> > On comparing the 2 pdfs in a comparison tool, I saw the following code/tags in the pdf that works (no config reference) that did not exist in the pdf that did not work (referenced config).
> > 
> > stream
> > <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> > 
> > <x:xmpmeta xmlns:x="adobe:ns:meta/">
> > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> > <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
> > <pdf:PDFVersion>1.4</pdf:PDFVersion>
> > <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> > </rdf:Description>
> > <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
> > <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> > </rdf:Description>
> > <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
> > <dc:date>
> > <rdf:Seq>
> > <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> > </rdf:Seq>
> > </dc:date>
> > </rdf:Description>
> > </rdf:RDF>
> > </x:xmpmeta>
> > <?xpacket end="r"?>
> > endstream
> > 
> > On overwriting this information to the other PDF (overwriting binary contents between stream and endstream), iText stops complaining and creates the watermark.
> > 
> > 
> > I am not sure why the configuration file reference is introducing some content that iText does not like, but I need to reference the configuration file. 
> > 
> > Any help towards getting this problem resolved is greatly appreciated.
> > 
> > Thanks,
> > Anil Pinto.
> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Anil Pinto <ap...@lobotec.com>.
Hi Jeremias,

Thank you for the response. Actually the presence of the XMP tags you mentioned does not cause the problem, the lack thereof does (there is some other binary data in the other pdf and no XMP information in the pdf that does not work with iText).

I will attach the 2 PDFs in my next email as I do not currently have them with me right now.

iText seems to parse the XMP packet, but the PDF that used the FOP config file (with no XMP) is having trouble.

Thanks,
Anil Pinto.


-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
Sent: Thursday, September 11, 2008 2:49 AM
To: fop-users@xmlgraphics.apache.org
Cc: apinto@lobotec.com
Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
allowed prolog" when referencing the FOP configuration file


When I implemented XMP functionality I've verified it with various tools.
The stacktrace shows that iText has a problem parsing the XMP packet in
the PDF. I'd ask the iText people first why they can't parse the XMP
packet. Maybe there's something wrong with their setting up of the XML
parser for the metadata stream. Without access to the two PDFs you
produced I have no idea why it works one time but not the other.

If you can open the PDF in Acrobat Reader and look at the metadata
("Additional Metadata..." button) then iText probably needs to improve
their code.

On 11.09.2008 02:30:26 Anil Pinto wrote:
> Hello,
> 
> I am in the process of evaluating iText for it's watermark capabilities on PDF.
> 
> I have been using FOP 0.95 since it's release for PDF creation. I have used previous versions of FOP but not with iText (2.1.3).
> 
> I was able to get the watermark to appear without problems when running iText on a PDF created by FOP 0.95 from the command prompt. When I tried the same from a PDF created using a standalone Java problem that used the API FOP  I encountered the error 
> 
> Exception in thread "main" ExceptionConverter: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
>         at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
>         at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
>         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
>         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
>         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
>         at temp.ITextTest.watermark(ITextTest.java:200)
>         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
>         at temp.ITextTest.main(ITextTest.java:218)
> 
> I initially thought it was something to do with (maybe) different parser references in the classpath. But was then able to replicate the problem with the same jars on the classpath.
> 
> I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> 
> The cause of the problem seemed to be when I used the user configuration reference to configure the fop. I was able to recreate the problem from the command line now while referencing the configuration file (fop.xconf). Without the config file iText gladly adds the watermark text.
> 
> On comparing the 2 pdfs in a comparison tool, I saw the following code/tags in the pdf that works (no config reference) that did not exist in the pdf that did not work (referenced config).
> 
> stream
> <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> 
> <x:xmpmeta xmlns:x="adobe:ns:meta/">
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
> <pdf:PDFVersion>1.4</pdf:PDFVersion>
> <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> </rdf:Description>
> <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
> <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> </rdf:Description>
> <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
> <dc:date>
> <rdf:Seq>
> <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> </rdf:Seq>
> </dc:date>
> </rdf:Description>
> </rdf:RDF>
> </x:xmpmeta>
> <?xpacket end="r"?>
> endstream
> 
> On overwriting this information to the other PDF (overwriting binary contents between stream and endstream), iText stops complaining and creates the watermark.
> 
> 
> I am not sure why the configuration file reference is introducing some content that iText does not like, but I need to reference the configuration file. 
> 
> Any help towards getting this problem resolved is greatly appreciated.
> 
> Thanks,
> Anil Pinto.




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Anil Pinto <ap...@lobotec.com>.
Jeremias,

Here are the PDF files and other resources in a .zip that I hope shed light on the situation.

The image file is a snapshot of the diff tool showing the section that I mentioned in my previous email. Note that when I copy the contents of the left and overwrite the contents on the right and save the PDF, the water mark is now created by iText without complains.

Hope this help and I really appreciate you taking the time to help further investigate this problem. Let me know if there is any more information you would like.

Thanks,
Anil Pinto.

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
Sent: Thursday, September 11, 2008 2:49 AM
To: fop-users@xmlgraphics.apache.org
Cc: apinto@lobotec.com
Subject: Re: FOP 0.95 and iText for watermarks throws "Content is not
allowed prolog" when referencing the FOP configuration file


When I implemented XMP functionality I've verified it with various tools.
The stacktrace shows that iText has a problem parsing the XMP packet in
the PDF. I'd ask the iText people first why they can't parse the XMP
packet. Maybe there's something wrong with their setting up of the XML
parser for the metadata stream. Without access to the two PDFs you
produced I have no idea why it works one time but not the other.

If you can open the PDF in Acrobat Reader and look at the metadata
("Additional Metadata..." button) then iText probably needs to improve
their code.

On 11.09.2008 02:30:26 Anil Pinto wrote:
> Hello,
> 
> I am in the process of evaluating iText for it's watermark capabilities on PDF.
> 
> I have been using FOP 0.95 since it's release for PDF creation. I have used previous versions of FOP but not with iText (2.1.3).
> 
> I was able to get the watermark to appear without problems when running iText on a PDF created by FOP 0.95 from the command prompt. When I tried the same from a PDF created using a standalone Java problem that used the API FOP  I encountered the error 
> 
> Exception in thread "main" ExceptionConverter: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
>         at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
>         at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
>         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
>         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
>         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
>         at temp.ITextTest.watermark(ITextTest.java:200)
>         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
>         at temp.ITextTest.main(ITextTest.java:218)
> 
> I initially thought it was something to do with (maybe) different parser references in the classpath. But was then able to replicate the problem with the same jars on the classpath.
> 
> I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> 
> The cause of the problem seemed to be when I used the user configuration reference to configure the fop. I was able to recreate the problem from the command line now while referencing the configuration file (fop.xconf). Without the config file iText gladly adds the watermark text.
> 
> On comparing the 2 pdfs in a comparison tool, I saw the following code/tags in the pdf that works (no config reference) that did not exist in the pdf that did not work (referenced config).
> 
> stream
> <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> 
> <x:xmpmeta xmlns:x="adobe:ns:meta/">
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
> <pdf:PDFVersion>1.4</pdf:PDFVersion>
> <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> </rdf:Description>
> <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
> <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> </rdf:Description>
> <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
> <dc:date>
> <rdf:Seq>
> <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> </rdf:Seq>
> </dc:date>
> </rdf:Description>
> </rdf:RDF>
> </x:xmpmeta>
> <?xpacket end="r"?>
> endstream
> 
> On overwriting this information to the other PDF (overwriting binary contents between stream and endstream), iText stops complaining and creates the watermark.
> 
> 
> I am not sure why the configuration file reference is introducing some content that iText does not like, but I need to reference the configuration file. 
> 
> Any help towards getting this problem resolved is greatly appreciated.
> 
> Thanks,
> Anil Pinto.




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

Re: FOP 0.95 and iText for watermarks throws "Content is not allowed prolog" when referencing the FOP configuration file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
When I implemented XMP functionality I've verified it with various tools.
The stacktrace shows that iText has a problem parsing the XMP packet in
the PDF. I'd ask the iText people first why they can't parse the XMP
packet. Maybe there's something wrong with their setting up of the XML
parser for the metadata stream. Without access to the two PDFs you
produced I have no idea why it works one time but not the other.

If you can open the PDF in Acrobat Reader and look at the metadata
("Additional Metadata..." button) then iText probably needs to improve
their code.

On 11.09.2008 02:30:26 Anil Pinto wrote:
> Hello,
> 
> I am in the process of evaluating iText for it's watermark capabilities on PDF.
> 
> I have been using FOP 0.95 since it's release for PDF creation. I have used previous versions of FOP but not with iText (2.1.3).
> 
> I was able to get the watermark to appear without problems when running iText on a PDF created by FOP 0.95 from the command prompt. When I tried the same from a PDF created using a standalone Java problem that used the API FOP  I encountered the error 
> 
> Exception in thread "main" ExceptionConverter: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
>         at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
>         at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:98)
>         at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
>         at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
>         at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
>         at temp.ITextTest.watermark(ITextTest.java:200)
>         at temp.ITextTest.applyWaterMark(ITextTest.java:128)
>         at temp.ITextTest.main(ITextTest.java:218)
> 
> I initially thought it was something to do with (maybe) different parser references in the classpath. But was then able to replicate the problem with the same jars on the classpath.
> 
> I am using JDK 1.5.0_06 with the necessary jars provided by fop.
> 
> The cause of the problem seemed to be when I used the user configuration reference to configure the fop. I was able to recreate the problem from the command line now while referencing the configuration file (fop.xconf). Without the config file iText gladly adds the watermark text.
> 
> On comparing the 2 pdfs in a comparison tool, I saw the following code/tags in the pdf that works (no config reference) that did not exist in the pdf that did not work (referenced config).
> 
> stream
> <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
> 
> <x:xmpmeta xmlns:x="adobe:ns:meta/">
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
> <pdf:PDFVersion>1.4</pdf:PDFVersion>
> <pdf:Producer>Apache FOP Version 0.95</pdf:Producer>
> </rdf:Description>
> <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
> <xmp:CreateDate>2008-09-10T16:53:50-07:00</xmp:CreateDate>
> </rdf:Description>
> <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
> <dc:date>
> <rdf:Seq>
> <rdf:li>2008-09-10T16:53:50-07:00</rdf:li>
> </rdf:Seq>
> </dc:date>
> </rdf:Description>
> </rdf:RDF>
> </x:xmpmeta>
> <?xpacket end="r"?>
> endstream
> 
> On overwriting this information to the other PDF (overwriting binary contents between stream and endstream), iText stops complaining and creates the watermark.
> 
> 
> I am not sure why the configuration file reference is introducing some content that iText does not like, but I need to reference the configuration file. 
> 
> Any help towards getting this problem resolved is greatly appreciated.
> 
> Thanks,
> Anil Pinto.




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org