LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Include portion of existing PDF document in my vibration report

Folks,

I'm attempting to standardize a 'final report' to give to customers.  There is a pdf document that has all the information I need to put a proper header on my report pages.  So, I'm not looking to create a pdf document, just import it into LabVIEW as an image and take the top 25% from it.  The bottom 75% is created by my code from saved data files.  Thanks in advance...

0 Kudos
Message 1 of 12
(1,886 Views)

You can use ImageMagick + GhostScript - just convert it with convert.exe MyFile.pdf MyFile.png, then import PNG to LabVIEW.

 

0 Kudos
Message 2 of 12
(1,863 Views)

Hi,

 

My solution would be to use the report generator where you can use a Word template file, add data to it and print it as a PDF.

 

Kees

0 Kudos
Message 3 of 12
(1,860 Views)

No.  I’m trying to do this within a single LabVIEW app.  The user will start the app by supplying a job number.  It will be the app’s job to grab the specified pdf from the job folder and take just the top 20% of it and save it as a .png file to use at the top of the six page report as the header.

 

0 Kudos
Message 4 of 12
(1,785 Views)

Come to think of it, don’t even need to save it, just use it for the report.

0 Kudos
Message 5 of 12
(1,784 Views)

Folks,

I am putting together an application to do this in a one step application, no other software.

I have job folders for every job my company does.

This same job folder contains the final vibration data before shipping of the product.

There is a pdf document in the job folder that has what would be an excellent header for each of the six pages of the final report.

So, the operator, starts the app and it requests a job number.

Once that job number is entered, I'm looking for my app to recall the given pdf form, cut off the top 20% of the form and then use that as the header for each page.

Below the header, my program is complete and works fine.

A time waveform in acceleration....

A velocity spectrum......

A table with the top 26 magnitude peaks from the velocity spectrum.

Can anybody help me get the front end of this task working?

All of the suggestions so far involve cutting and pasting while the document is still an adobe document.  That's not what I need.

Again, no input from the end user except the job number.  

Thanks in advance....

Ron B

 

Report Example for NI Board.jpg

0 Kudos
Message 6 of 12
(1,889 Views)

LabVIEW has no built-in PDF reading support so you need to somehow use external code.  You can still call libraries other people made without opening Adobe reader or whatever, so I'm hoping that meets your requirement of "no other software".

 

I found this library in a couple minutes of searching.  I downloaded it to confirm the DLL is browsable with LabVIEW's build in .NET support, but I've done nothing beyond that to see if it can do what you need it to do.  If it doesn't, then maybe you could find a different one.

0 Kudos
Message 7 of 12
(1,876 Views)

@Coryman wrote:

There is a pdf document in the job folder..

 

 


If you back up a bit.... One might ask how that pdf got into that folder in the first place? Perhaps a friendlier format could also be produced? Or maybe create a pre-process of making a png file that you could use instead of the pdf?

 

Just some random thoughts out-side-the-box.

 

Good luck

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 8 of 12
(1,830 Views)

PDF files specify how documents look. There's no standard way a PDF is formatted to achieve this, and that makes it incredibly hard to read (parse) just any given PDF.

 

For instance, a PDF writer might decide to 'encode' the text in a PDF with a custom font (where 0x61 isn't an 'a' but a 'Q'), and 'write' letters from bottom to top, right to left, or even randomly. It will look normal, but parsing it would be very hard.

 

Because of this, parsing PDFs requires either very clever heuristics and\or OCR-ish trickery... That is why PDF readers aren't available as much as PDF writers.

0 Kudos
Message 9 of 12
(1,779 Views)

With Ghostscript you can convert a PDF to any picture format.

There is also a command line option.

Maybe you can use this.

 

Kees

 

0 Kudos
Message 10 of 12
(1,741 Views)