LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Screenshots of Panel as .PDF

Dear Guys,

 

Can anyone give me an idea about how to generate a screenshot of a panel and save it in a .PDF format. I found that there are some options to save them in .jpg, .png etc.

Hope someone might have figured how to do that in Labwindows.

 

Thanks

Raunak

0 Kudos
Message 1 of 4
(3,942 Views)

In this question there are two different aspects you need to deal with: a.taking the screenshot and b.saving to PDF.

 

If your application has a single panel or one parent panel with some child panels embedded you can simply use GetPanelDisplayBitmap instruction to obtain a bitmap image in memory of the panel. On the other hand, if your application is multpanel (or if you want to take a shot of the entire screen, including areas not pertaining to your application) you can look at this example I posted some while ago.

 

The second aspect is to create a PDF. The simplest way is to use one of the multiple applications that create a "pdf printer" and use PRintPanel to simply generate the PDF (depending on the application you use, some user interaction may be needed). Alternatively, you could try integrating into your application some library to genreate PDF files: I have tested succesfully HARU PDF library and created an example of how to create a report with text and graphics with it: you can see it here.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(3,936 Views)

Hi,

 

I used the PDFGen by Andre Renaud found on github. With minor modification, I was able to make an instrument (pdf.fp) and include it in my toolbox. Also added a function that adds CVI panel bitmap to the file using the AllocBitmapData() and GetBitmapData() functions. PDFGen supports 24 bits RGB only. On 32 bit RGB, you have to convert it to 24 bits.

 

I also tried libharu, but was not successful. Maybe you have to use an older version to succeed.

 

Best Regards,

Jan

 

0 Kudos
Message 3 of 4
(3,930 Views)

Hello Gaus,

 

Since I am new to Labwindows can you tell me step by step how to use the functions.

Or if you have a smaple of it, can you please share it with me.

 

Regards

Raunak

0 Kudos
Message 4 of 4
(3,904 Views)