From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to overwirte data in a *.pdf file using LabVIEW??

hi,

i have a requirement to overwrite a pdf file using LabVIEW, i have to use coloring text also.

i have downloaded Exaprom PDF 1.0 toolkit. but it is to generate a new pdf file.

please suggest ideas

 

regards

phani srikanthSpell Check

phani srikanth
0 Kudos
Message 1 of 8
(5,802 Views)

Is it possible? Sure. If you know the PDF file format.

 

Otherwise, you have to find a PDF creator/editor that has an external API, like an ActiveX interface, or perhaps a .NET interface. Adobe Acrobat has one. Of course, you have to buy Adobe Acrobat.

0 Kudos
Message 2 of 8
(5,793 Views)

I did not have the PDF file format. If I have that what is the procedure to edit/overwrite the particular data.?

 

 

Yes I have downloaded Adobe Acrobat X pro Trail Version. I am finding difficulty to read the data from from a PDF file.

It will be very helpful if you explain the procedure or provide an sample VI

phani srikanth
0 Kudos
Message 3 of 8
(5,776 Views)

Modifying an existing PDF file is several magnitues more complicated than creating one from scratch. The PDF standard is VERY complicated and contains a myriad of features with their specific syntax elements. In order to modify an existing PDF you have to be able to understand every syntax element that occures in the PDF, or you may end up corrupting the file.

 

When you create a new PDF you can pick out the syntax elements that your tool supports and forget about the 95 other procent.

 

There are many PDF Toolkits than can create PDF files, a few that can open PDF files and present them, and almost none that can edit them. The Adobe PDF Editor being one of the few that can do that, but nobody is going to give away such a Toolkit for free.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 8
(5,768 Views)

@srikanthphani wrote:

I did not have the PDF file format. If I have that what is the procedure to edit/overwrite the particular data.?

 

 

Yes I have downloaded Adobe Acrobat X pro Trail Version. I am finding difficulty to read the data from from a PDF file.

It will be very helpful if you explain the procedure or provide an sample VI


I have no procedure or VI to do this. You will need to look at the examples that ship with Acrobat to see how to use the ActiveX component. There may be examples posted on this forum. Search for them.

 

You can call ActiveX from LabVIEW. There are examples that ship with LaBVIEW on calling ActiveX.

0 Kudos
Message 5 of 8
(5,754 Views)

If you know exactly where you want to overwrite a PDF file, it is possible with iTextsharp (Exaprom PDF uses iTextsharp).  However, like it is said in the previous answers, if you have to read the PDF file to find the location where you want to overwrite, it will probably be a lot more difficult...

 

The example within the Exaprom PDF library has, in fact, two major steps:

 

1) Create a PDF file (without footer, header, and watermark)

               a) create a PDF file name “File A”;

               b) add everything except footer, header, and watermark;

               c) close “File A”,

2) Overwriting the footer, the header, and the watermark

               a) Read “File A”

               b) overwrite the footer, the header, and the watermark;

               c) Close “File A”.

 

In my case, it is easy because I know exactly where (X,Y) I want to overwrite those elements (In fact, it is a bit more complicated because I need to create a temporary file).

0 Kudos
Message 6 of 8
(5,731 Views)

I did something in the past that may get you started. It is part of a bigger piece of code and not easy to extract.

 

You can use the 'stamper' functionality to open and modify a pdf file. It has been some time ago so I don't know if you can also use the stamper to locate stuff in the pdf.

 

I attached a screenshot of my code (which inserts a TOC that I create after making the document) but this also doesn't work without flaws (yet..).

 

Please keep us updated if you find a good solution.

 

Kind regards,

 

Mark

 

pdf stamper.PNG

---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
0 Kudos
Message 7 of 8
(5,503 Views)

@ericward wrote:

So in conclusion the answer to this question is no, right? I think you can try the advice from J-M, the iTEXT seems to be a feasible solution. It is free and many people have already used it for processing pdf files.


The answer to the question "is possible" is yes, the question of "how" has not been answered yet.

0 Kudos
Message 8 of 8
(5,327 Views)