Dynamic Headers with pictures or barcodes

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic Headers with pictures or barcodes

Sarita Puri

Hello,

I’m trying to add headers/footers to my PDF file and need some help.  The header can have text, pictures, barcode labels etc which I have an idea how to do but the tricky part is that the data is dynamic and varies based on an xml configuration file.   For example the config file may define the header has 3 columns, so every page header will have 3 static labels followed by the dynamic values coming from a database, like following:-

Page1

Label1: TextA

 

Label2: TextB

 

Label3: TextC

 

Page2

Label1: TextD

 

Label2: TextE

 

Label3: TextF

 

Page3

Label1: TextX

 

Label2: TextY

 

Label3: TextZ

 

 

Or it could be 2 columns with a static label, dynamic value and a dynamic image like this:-

Page1

Label1: TextA

 

Image1

 

Page2

Label1: TextB

 

Image2

 

Page3

Label1: TextC

 

Image3

 

 

Or anything else, so like an array of arrays or a hash. 

 

The steps to do this are:–

1)     Read the config file and define the header template. 

2)     In the pageEnd event fill the template with data.  I don’t know how exactly to pass the data.

 

Is this the right approach?  Any help with some sample code will be greatly appreciated. Also I’ve read that the templates increase the file size quite a bit, is there any other work-around possible?

 

Thanks,

Sarita Puri

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

image001.jpg (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Sarita Puri

I saw that my posting on the forum did not have any body, so here is my question again (in plain text):

 

Hello,

 

I’m trying to add headers/footers to my PDF file and need some help.  The header can have text, pictures, barcode labels etc which I have an idea how to do but the tricky part is that the data is dynamic and varies based on an xml configuration file.   For example the config file may define the header has 3 columns, so every page header will have 3 static labels followed by the dynamic values coming from a database, like following:-

 

Page1

           Label1: TextA             Label2: TextB               Label3: TextC

Page2

           Label1: TextD              Label2: TextE               Label3: TextF

Page3

           Label1: TextX              Label2: TextY              Label3: TextZ

 

Or it could be 2 columns with a static label, dynamic value and a dynamic image like this:-

 

Page1

           Label1: TextA                                      Image1

Page2

           Label1: TextB                                       Image2

Page3

           Label1: TextC                                      Image3

 

Or anything else, so like an array of arrays or a hash. 

 

I think the steps to do this are:–

1)     Read the config file and define the header template. 

2)     In the pageEnd event fill the template with data.  I don’t know how exactly to pass the data.

 

Is this the right approach?  Any help with some sample code will be greatly appreciated. Also I’ve read that the templates increase the file size quite a bit, is there any other work-around possible?

 

 

 

Thanks,

Sarita Puri

 

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

image001.jpg (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Sarita Puri
In reply to this post by Sarita Puri

I saw that my posting on the forum did not have any body, so here is my
question again (in plain text):

Hello,

I'm trying to add headers/footers to my PDF file and need some help.  The
header can have text, pictures, barcode labels etc which I have an idea how
to do but the tricky part is that the data is dynamic and varies based on an
xml configuration file.   For example the config file may define the header
has 3 columns, so every page header will have 3 static labels followed by
the dynamic values coming from a database, like following:-

Page1
        Label1: TextA Label2: TextB Label3: TextC
Page2
        Label1: TextD Label2: TextE Label3: TextF
Page3
        Label1: TextX Label2: TextY Label3: TextZ

Or it could be 2 columns with a static label, dynamic value and a dynamic
image like this:-

Page1
        Label1: TextA Image1
Page2
        Label1: TextB Image2
Page3
        Label1: TextC Image3

Or anything else, so like an array of arrays or a hash.  

I think the steps to do this are:-
1)     Read the config file and define the header template.  
2)     In the pageEnd event fill the template with data.  I don't know how
exactly to pass the data.

Is this the right approach?  Any help with some sample code will be greatly
appreciated. Also I've read that the templates increase the file size quite
a bit, is there any other work-around possible?

 

Thanks,
Sarita Puri





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Sarita Puri
In reply to this post by Sarita Puri

I saw that my posting on the forum did not have any body, so here is my
question again (in plain text):

Hello,

I'm trying to add headers/footers to my PDF file and need some help.  The
header can have text, pictures, barcode labels etc which I have an idea how
to do but the tricky part is that the data is dynamic and varies based on an
xml configuration file.   For example the config file may define the header
has 3 columns, so every page header will have 3 static labels followed by
the dynamic values coming from a database, like following:-

Page1
        Label1: TextA Label2: TextB Label3: TextC
Page2
        Label1: TextD Label2: TextE Label3: TextF
Page3
        Label1: TextX Label2: TextY Label3: TextZ

Or it could be 2 columns with a static label, dynamic value and a dynamic
image like this:-

Page1
        Label1: TextA Image1
Page2
        Label1: TextB Image2
Page3
        Label1: TextC Image3

Or anything else, so like an array of arrays or a hash.  

I think the steps to do this are:-
1)     Read the config file and define the header template.  
2)     In the pageEnd event fill the template with data.  I don't know how
exactly to pass the data.

Is this the right approach?  Any help with some sample code will be greatly
appreciated. Also I've read that the templates increase the file size quite
a bit, is there any other work-around possible?

 

Thanks,
Sarita Puri







-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Paulo Soares
I'm not sure what kind of answer you expect. You already know about the
OnEndPage() event, the rest is Java programing.

Paulo

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]]
> On Behalf Of Sarita Puri
> Sent: Friday, January 25, 2008 2:24 PM
> To: 'Post all your questions about iTextSharp here'
> Subject: Re: [itextsharp-questions] Dynamic Headers with
> pictures or barcodes
>
>
> I saw that my posting on the forum did not have any body, so
> here is my
> question again (in plain text):
>
> Hello,
>
> I'm trying to add headers/footers to my PDF file and need
> some help.  The
> header can have text, pictures, barcode labels etc which I
> have an idea how
> to do but the tricky part is that the data is dynamic and
> varies based on an
> xml configuration file.   For example the config file may
> define the header
> has 3 columns, so every page header will have 3 static labels
> followed by
> the dynamic values coming from a database, like following:-
>
> Page1
> Label1: TextA Label2: TextB Label3: TextC
> Page2
> Label1: TextD Label2: TextE Label3: TextF
> Page3
> Label1: TextX Label2: TextY Label3: TextZ
>
> Or it could be 2 columns with a static label, dynamic value
> and a dynamic
> image like this:-
>
> Page1
> Label1: TextA Image1
> Page2
> Label1: TextB Image2
> Page3
> Label1: TextC Image3
>
> Or anything else, so like an array of arrays or a hash.  
>
> I think the steps to do this are:-
> 1)     Read the config file and define the header template.  
> 2)     In the pageEnd event fill the template with data.  I
> don't know how
> exactly to pass the data.
>
> Is this the right approach?  Any help with some sample code
> will be greatly
> appreciated. Also I've read that the templates increase the
> file size quite
> a bit, is there any other work-around possible?
>
>  
>
> Thanks,
> Sarita Puri

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.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Sarita Puri
Thanks for replying Paulo.  Yes, I figured it out that its not iTextSharp
issue but C# programming.   But my second question remains - huge file size
when using templates, any suggestions?

Sarita Puri
Clear Spider Inc.
905-629-4444 xt. 2109
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
Paulo Soares
Sent: Friday, January 25, 2008 10:37 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Dynamic Headers with pictures or
barcodes

I'm not sure what kind of answer you expect. You already know about the
OnEndPage() event, the rest is Java programing.

Paulo

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]]
> On Behalf Of Sarita Puri
> Sent: Friday, January 25, 2008 2:24 PM
> To: 'Post all your questions about iTextSharp here'
> Subject: Re: [itextsharp-questions] Dynamic Headers with
> pictures or barcodes
>
>
> I saw that my posting on the forum did not have any body, so
> here is my
> question again (in plain text):
>
> Hello,
>
> I'm trying to add headers/footers to my PDF file and need
> some help.  The
> header can have text, pictures, barcode labels etc which I
> have an idea how
> to do but the tricky part is that the data is dynamic and
> varies based on an
> xml configuration file.   For example the config file may
> define the header
> has 3 columns, so every page header will have 3 static labels
> followed by
> the dynamic values coming from a database, like following:-
>
> Page1
> Label1: TextA Label2: TextB Label3: TextC
> Page2
> Label1: TextD Label2: TextE Label3: TextF
> Page3
> Label1: TextX Label2: TextY Label3: TextZ
>
> Or it could be 2 columns with a static label, dynamic value
> and a dynamic
> image like this:-
>
> Page1
> Label1: TextA Image1
> Page2
> Label1: TextB Image2
> Page3
> Label1: TextC Image3
>
> Or anything else, so like an array of arrays or a hash.  
>
> I think the steps to do this are:-
> 1)     Read the config file and define the header template.  
> 2)     In the pageEnd event fill the template with data.  I
> don't know how
> exactly to pass the data.
>
> Is this the right approach?  Any help with some sample code
> will be greatly
> appreciated. Also I've read that the templates increase the
> file size quite
> a bit, is there any other work-around possible?
>
>  
>
> Thanks,
> Sarita Puri


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.






-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Paulo Soares
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]]
> On Behalf Of Sarita Puri
> Sent: Friday, January 25, 2008 4:08 PM
> To: 'Post all your questions about iTextSharp here'
> Subject: Re: [itextsharp-questions] Dynamic Headers with
> pictures or barcodes
>
> Thanks for replying Paulo.  Yes, I figured it out that its
> not iTextSharp
> issue but C# programming.   But my second question remains -
> huge file size
> when using templates, any suggestions?
>
I've never experienced those "huge" file sizes but I suppose that it
will depend on the options or skills of the programmer. If you have one
of those huge PDFs I would like to see it.

Paulo


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.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

Assent
This post has NOT been accepted by the mailing list yet.
In reply to this post by Sarita Puri
free .net barcode generator for creating barcode images
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Headers with pictures or barcodes

calosteward
This post has NOT been accepted by the mailing list yet.
In reply to this post by Sarita Puri
Based on your description,I found a sample code on google for you:
public static Image GetPageImage(int pageNumber)
{
            if(pageNumber==1)
                    return ImageForPage1
            else
                    return ImageForPage2
}
Your PictureBox Binding should look like:

Property Path      Value

Value                = GetPageImage(Parameters.OrgLogo.Value, PageNumber)

Hope you can create dynamic headers with barcode and pictures correctly.
Best regrads.