We are using the following as suggested by you in one of the examples you shared where PageNumbersWebDraftEventHelper is the class we have written that has all the onPageEnd etc methods.
 
PageNumbersWebDraftEventHelper events = new PageNumbersWebDraftEventHelper();
writer.setPageEvent(events);
 
HeaderFooter header1 = new HeaderFooter(new Phrase(),new Phrase("# "+(ID)+" Text"));
document.setHeader(header1);
header1.setAlignment(Element.ALIGN_LEFT);
//document is the Document object and is is InputSource object formed using the XML
//String
XmlParser.parse(document, is);
 
It is printing the page numbers and header for us as of now.
 
This header is same for the entire PDF.
 
We wanted different header for different sections in the PDF.
I hope this provides you the necessary data and is not confusing.
 
Regards,
Leena
 
Leena Kulkarni wrote:
> We are generating one xml on the fly

Why? If I want to go from Brussels to Ghent,
I don't make a detour to Paris. I use the
shortest way.

> and before parsing we are setting
> the page numbers and the headers.

I don't understand how that can ever work?
How do you even know how many page number
there will be before you start parsing?
XML doesn't know about pages.

Typically you add page numbers in a page
event, as is done in the Romeo and Juliet
example in the tutorial.

> So basically we have all the 'parts' processed and are in the form of an
> xml.
> I am doubtful if this would work for us.

I think we don't understand each other.

If you want to parse different XML files
into one PDF, you need to subclass the SAXiTextHandler.
It's a piece of cake to tell the page event implementation
another header/footer should be used for every separate
XML file.

Depending on your exact requirements, it could
also be a good idea to parse each different XML
into a separate PDF. Then concatenate and stamp
the headers/footers on the PDF. We called 'generating
a PDF in multiple passes'.

I don't know what solution would be best for you,
I don't know anything about the design decisions
that were made.
br,
Bruno

[EMAIL PROTECTED] wrote:
Send iText-questions mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/itext-questions
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of iText-questions digest..."


Today's Topics:

1. Question itext (Frank)
2. Re: Question itext (Paulo Soares)
3. Problem Applying Watermark to files created by Adobe
illustrator (mohan alagurajan)
4. Template with color (Develop)
5. Re: Problem Applying Watermark to files created by Adobe
illustrator (Leonard Rosenthol)
6. Re: Template with color (Paulo Soares)
7. Re: Problem Applying Watermark to files created byAdobe
illustrator (Paulo Soares)
8. Re: Problem Applying Watermark to files created by Adobe
illustrator (mohan alagurajan)
9. Re: Problem Applying Watermark to files created by Adobe
illustrator (Paulo Soares)


----------------------------------------------------------------------

Message: 1
Date: Mon, 31 Jul 2006 10:09:07 -0500
From: Frank <[EMAIL PROTECTED]>
Subject: [iText-questions] Question itext
To: [email protected]
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hi, I have the followin problem:

I am constructing a pdf, but I have several portions of html, that in
several parts of the document i have to use a parser in this case,
HtmlParser, but no work because it close the document in the first parser.
How i solve this problem.

Thank for any help.

Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://sourceforge.net/mailarchive/forum.php?forum=itext-questions/attachments/20060731/582ec3c3/attachment.html

------------------------------

Message: 2
Date: Mon, 31 Jul 2006 17:53:55 +0100
From: "Paulo Soares" <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] Question itext
To: "Post all your questions about iText here"

Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"

Use HTMLWorker.

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Frank
> Sent: Monday, July 31, 2006 4:09 PM
> To: [email protected]
> Subject: [iText-questions] Question itext
>
> Hi, I have the followin problem:
>
> I am constructing a pdf, but I have several portions of html,
> that in several parts of the document i have to use a parser
> in this case, HtmlParser, but no work because it close the
> document in the first parser.
> How i solve this problem.
>
> Thank for any help.
>
> Frank
>
>


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.




------------------------------

Message: 3
Date: Mon, 31 Jul 2006 11:23:10 -0700 (PDT)
From: mohan alagurajan <[EMAIL PROTECTED]>
Subject: [iText-questions] Problem Applying Watermark to files created
by Adobe illustrator
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii


Hi All,

Thanks, for the continued help provided by everyone in this forum.

I have to apply Watermark to PDFDocuments, and I use the code below for
that, it works fine except for some documents which are created by Adobe
Illustrator and I dont know the reason why? Is there any problem with the
following code or is it a bug in iText? Is there any workaround for this
problem.

PdfReader reader = new PdfReader("C:/26JUL2005.pdf");
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream("C:/stamped/26JUL2005_stamped.pdf"));
int pages = reader.getNumberOfPages();
System.out.println("Pages: " + pages);
int i=0;
PdfContentByte over = null;
BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI,
BaseFont.EMBEDDED);
while (i i++;
System.out.println("Processing Page : " + i);
over = stamper.getOverContent(i);
over.beginText();
over.setFontAndSize(bf, 8);
over.setTextMatrix(30, 30);
over.showText("Watermark Text");
over.setFontAndSize(bf, 8);
over.endText();
}
stamper.setFormFlattening(true);
stamper.close();
--
View this message in context: http://www.nabble.com/Problem-Applying-Watermark-to-files-created-by-Adobe-illustrator-tf2029229.html#a5581233
Sent from the iText - General forum at Nabble.com.




------------------------------

Message: 4
Date: Mon, 31 Jul 2006 18:26:46 +0000 (GMT)
From: Develop <[EMAIL PROTECTED]>
Subject: [iText-questions] Template with color
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

Is it possible to create a template with a determined color?
For example, I need to create a template area with a background blue color.

Thanks

Rodrigo


---------------------------------
Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://sourceforge.net/mailarchive/forum.php?forum=itext-questions/attachments/20060731/615d3585/attachment.html

------------------------------

Message: 5
Date: Mon, 31 Jul 2006 11:41:07 -0700
From: Leonard Rosenthol <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] Problem Applying Watermark to files
created by Adobe illustrator
To: Post all your questions about iText here
,
[email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 11:23 AM 7/31/2006, mohan alagurajan wrote:
>I have to apply Watermark to PDFDocuments, and I use the code below for
>that, it works fine except for some documents which are created by Adobe
>Illustrator

What do you mean it "doesn't work fine"? What happens (or
doesn't happen)? Can you provide before & after docs?


Leonard

---------------------------------------------------------------------------
Leonard Rosenthol
Chief Technical Officer
PDF Sages, Inc. 215-938-7080 (voice)
215-938-0880 (fax)




------------------------------

Message: 6
Date: Mon, 31 Jul 2006 19:40:32 +0100
From: "Paulo Soares" <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] Template with color
To: "Post all your questions about iText here"

Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original

You can create a template with anything inside. Set the color fill to blue,
draw the rectangle and fill.

Paulo

----- Original Message -----
From: "Develop" <[EMAIL PROTECTED]>
To:
Sent: Monday, July 31, 2006 7:26 PM
Subject: [iText-questions] Template with color


Hi,

Is it possible to create a template with a determined color?
For example, I need to create a template area with a background blue
color.

Thanks

Rodrigo


---------------------------------
Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular.
Registre seu aparelho agora!


--------------------------------------------------------------------------------


> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


--------------------------------------------------------------------------------


> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>




------------------------------

Message: 7
Date: Mon, 31 Jul 2006 19:41:22 +0100
From: "Paulo Soares" <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] Problem Applying Watermark to files
created byAdobe illustrator
To: "Post all your questions about iText here"

Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original

You forgot to tell us what the problem is.

Paulo

----- Original Message -----
From: "mohan alagurajan" <[EMAIL PROTECTED]>
To:
Sent: Monday, July 31, 2006 7:23 PM
Subject: [iText-questions] Problem Applying Watermark to files created
byAdobe illustrator


>
> Hi All,
>
> Thanks, for the continued help provided by everyone in this forum.
>
> I have to apply Watermark to PDFDocuments, and I use the code below for
> that, it works fine except for some documents which are created by Adobe
> Illustrator and I dont know the reason why? Is there any problem with the
> following code or is it a bug in iText? Is there any workaround for this
> problem.
>
> PdfReader reader = new PdfReader("C:/26JUL2005.pdf");
> PdfStamper stamper = new PdfStamper(reader, new
> FileOutputStream("C:/stamped/26JUL2005_stamped.pdf"));
> int pages = reader.getNumberOfPages();
> System.out.println("Pages: " + pages);
> int i=0;
> PdfContentByte over = null;
> BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI,
> BaseFont.EMBEDDED);
> while (i> i++;
> System.out.println("Processing Page : " + i);
> over = stamper.getOverContent(i);
> over.beginText();
> over.setFontAndSize(bf, 8);
> over.setTextMatrix(30, 30);
> over.showText("Watermark Text");
> over.setFontAndSize(bf, 8);
> over.endText();
> }
> stamper.setFormFlattening(true);
> stamper.close();
> --
> View this message in context:
> http://www.nabble.com/Problem-Applying-Watermark-to-files-created-by-Adobe-illustrator-tf2029229.html#a5581233
> Sent from the iText - General forum at Nabble.com.
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions




------------------------------

Message: 8
Date: Mon, 31 Jul 2006 12:10:22 -0700 (PDT)
From: mohan alagurajan <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] Problem Applying Watermark to files
created by Adobe illustrator
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii


The problem is that the applied Watermark is not visible in the new document.
There is no visual difference before and after applying the Watermark.

Thanks
mohan
--
View this message in context: http://www.nabble.com/Problem-Applying-Watermark-to-files-created-by-Adobe-illustrator-tf2029229.html#a5582071
Sent from the iText - General forum at Nabble.com.




------------------------------

Message: 9
Date: Mon, 31 Jul 2006 20:28:09 +0100
From: "Paulo Soares" <[EMAIL PROTECTED]>
Subject: Re: [iText-questions] Problem Applying Watermark to files
created by Adobe illustrator
To: "Post all your questions about iText here"

Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original

Check the crop box dimensions, that's the area that you'll see and you may
be watermarking outside this.

Paulo

----- Original Message -----
From: "mohan alagurajan" <[EMAIL PROTECTED]>
To:
Sent: Monday, July 31, 2006 8:10 PM
Subject: Re: [iText-questions] Problem Applying Watermark to files created
by Adobe illustrator


>
> The problem is that the applied Watermark is not visible in the new
> document.
> There is no visual difference before and after applying the Watermark.
>
> Thanks
> mohan
> --
> View this message in context:
> http://www.nabble.com/Problem-Applying-Watermark-to-files-created-by-Adobe-illustrator-tf2029229.html#a5582071
> Sent from the iText - General forum at Nabble.com.
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions




------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions


End of iText-questions Digest, Vol 2, Issue 121
***********************************************


Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to