LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate PDF files with Exaprom iTextSharp

The reason I make several files and them cat them together is because the header of the files are different. I could build the file all at once if I could change the header page by page. Is this possible?

 

Norm

0 Kudos
Message 11 of 25
(1,600 Views)

Glad you think there is some kind of solution I was about to give up and go with another process.  How do I open an existing PDF?  I didn't see that VI in the toolkit.  I tried modifying the New PDF.vi to have Open on the FIle Stream Mode instead of create and that got farther but then on close there were other exceptions thrown.

0 Kudos
Message 12 of 25
(1,587 Views)

 

What you want to do is done by "Append Header, Footer and Watermark.vi" in "Close PDF.vi".

Close PDF.png

 

If we provide the mandatory informations, this VI could run "as a standalone".

Close PDF.png

 

The XControl "PDF Report" needs:

1) a path (the actual PDF file you want to modify);

2) at least a Header  or a Footer;

3) "Page dimensions [ ]" in point (1 inch = 72 points)

4) a font.

 

You also have to modify (to add a white background color):

user.lib\Exaprom PDF\VIs\Low level\Header, Footer and Watermark Low level\Header Footer Add Cell.vi

Close PDF.png

0 Kudos
Message 13 of 25
(1,577 Views)

Viper wrote:

 

"The reason I make several files and them cat them together is because the header of the files are different. I could build the file all at once if I could change the header page by page. Is this possible?

 

Norm"

 

The short answer is no, not because of iTextSharp, but because I have not thought of that (more than one header) when I wrote this library.

0 Kudos
Message 14 of 25
(1,570 Views)

Wow fantastic.  There are some more things I need to do to make it happy but it works great.  I also had to set the background color in the other case, where the curreng page number is not greater or equal to the Start Page.  I also found your VI for making the font reference so that helped.

 

As for the Page Dimensions I wrote a VI that would use the PDFReader and read the existing PDF to get the Width, Height, and orientation for all pages.  I couldn't find a property to read back the margins.  At the moment I'm just going to assume 1 inch (72 px) on all sides but to be more generic it would be nice if I could read this back.  Is that property exposed?  If not this will still work.

0 Kudos
Message 15 of 25
(1,550 Views)

Hey another question, how did you connect a XControl to your connector pane of a subVI?  As far as I knew you couldn't do that.

 

Also in the future I think a Class would have worked much better than an XControl with no purpose on the UI.

0 Kudos
Message 16 of 25
(1,541 Views)

I am glad it helps.

 

A couples years ago, I worked hard to read the margins:  this property does not exist (or didn't work - I don't remember).

 

For the XControl:

 

To be honest, I don't remember.  It is the only XControl I create and It was in 2010.  I replaced (2012) the XControl by a Class in the actual version I use.

0 Kudos
Message 17 of 25
(1,540 Views)

@J-M wrote:

 

To be honest, I don't remember.  It is the only XControl I create and It was in 2010.  I replaced (2012) the XControl by a Class in the actual version I use.


So I figured out you can replace a control already on the connector pane with an XControl and it keeps the connector pane connection but links it to the new XControl.

 

The community sure would appreciate it if you were to release that 2012 version with classes.  In any case thank you very much for the help.

0 Kudos
Message 18 of 25
(1,525 Views)

The major problem I have to release this new version is my level in English.  I wrote a user manual in English, but I am not really proud of that work…  I don’t want to release a user manual full of errors.  If you want to have a taste, you could take a look at the table of content (post #3):

 

http://forums.ni.com/t5/LabVIEW/How-to-create-PDF-Bookmarks-with-Exaprom-PDF/m-p/2804268#M822194

 

The major additions are:

 

- more options for the tables (but it is less intuitive);

- bookmarks and Table of Content;

- possibility to add PDF files in the report (direct concatenation in the report);

- UTF-16 (Basic Multilingual Plane);

- class for PDF Repor;

- class for tables.

0 Kudos
Message 19 of 25
(1,502 Views)

@Hooovahh wrote:

Hey another question, how did you connect a XControl to your connector pane of a subVI?  As far as I knew you couldn't do that.

 

Also in the future I think a Class would have worked much better than an XControl with no purpose on the UI.


I have the same problem. So I made a copy of one of the Exaprom VI's gutted the contents leaving the two refs and error clusters and save it as a template.

 

Norm

0 Kudos
Message 20 of 25
(1,493 Views)