LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using PrintPanel to create PDF files

 

 

Background:

I'm using PrintPanel along with PDF995 to automatically generate test reports without operator interaction.

PDF995 uses a .INI file called PDF995.INI which contains entries that allow you to specify the folder where the PDF file will be written.

I use the inifile.fp functions in toolslib to modifiy the .INI file with the correct folder name.
Then I use SetPanelAttribute to modify ATTR_TITLE.  This is used by PDF995 to name the PDF file.

Everything (almost) works fine and I end up with automatically named PDF files in the folders where they should be.

 

Problem:
It seems that either PrintPanel or the PDF995 printer driver has a significant amount of delay time to process the file.
I have to put a Delay(5.0) call between each file.
If I don't use the delay, it seems to overwrite the .INI file entry before PDF995 has a chance to use it.


Question:
Is there some way to get a status back that indicates when PrintPanel has in fact finished sending the panel to the printer driver so I can know when to move on to the next file?

 

Thanks,
Kirk

 

 

 

0 Kudos
Message 1 of 19
(4,333 Views)

I have tried in the past to run your same way but finally I ended up using another product to generate PDF files (HARU pdf library): on one hand I faced your same problem and found no solution to it; additionally I consider the advertising PDF995 shows when used not compatible with an industrial application.

I can assure you that the time spent in learning how to use the library is well compensated by the very fast execution of reporting functions, the small dimensions of generated files and the flexibility of the instrument.

You can find an example of how to use the library following the link in my signature.



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 19
(4,324 Views)

Roberto,

 

You can get rid of the advertising that PDF995 displays by paying the $9.95 for a licensed copy.  I'm currently using this method in a production application in which the delay is not a problem.  The new application I'm working on must process 1000's of archived data files and generate reports so it becomes a bigger issue.

 

I downloaded the PDFTextReport.zip file and took a look at the code.  I have not yet downloaded the HARU library.

One question: What is the EToolbox_10.lib file in the project?

 

These reports are not text files.

How difficult would it be to use HARU to generate a full image of a panel similar to the way PrintPanel does?

Our report panel contains 2 graphs and other CVI user interface objects that need to be duplicated on the report.

 

 

I'll try to dig into the HARU functions a little deeper.

 

Thank you much for the valuable information,

Kirk

 

 

 

0 Kudos
Message 3 of 19
(4,307 Views)

HARU library includes functions to insert images in the pages as well as text informations. I am presently using it to generate mixed text / graph reports; you can either load images from physical files or translate bitmaps in memory. I'll try to update that example including image treatment.

 

EToolbox is a library I developed with common functions I use in my applications. I don't remember exactly but I suppose I am using it in the example just for error reporting.

 

With respect to PDF995 I know I can purchase a license and get rid of advertising, but several of my customers have very strict rules regarding the software installed into their machines so I tend to avoid using third party tools that need a license if I can do things some other way.



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?
0 Kudos
Message 4 of 19
(4,299 Views)

I just want to inform you that I have updated the example including the ability to include in the report a bitmap in memory: this can be useful in that you can call GetPanelDisplayBitmap to obtain the panel image and include it in a page of the report. Ability to load the image from disk was already present in the code.



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?
0 Kudos
Message 5 of 19
(4,288 Views)

Hi,

 

I'm also trying to do something similar, and this HARU library seems to be a good solution. This may seem a silly question, but could you please advise me with how to add the files downloaded from the HARU site to LabWindows? I have Unzipped the file downloaded but I am then unclear what I should do with the files contained in this, even after reading the installation instuctions on their website.

 

Many thanks

 

Ben

0 Kudos
Message 6 of 19
(4,252 Views)

Hello Ben, this is the simple setup I use:

 

  • include hpdf.h in your source files and have the file available in the search path
  • add libhpdf.lib to your project
  • have libhpdf.dll available in the search path in both development and destination PC. The dll can be put either in the application directory or in standard search path for DLLs (e.g in XP is c:\windows\system32)

 



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?
0 Kudos
Message 7 of 19
(4,243 Views)

Thanks very much for the help Roberto, I believe that I have now done this correctly, I have included hpdf.h in the source code, added libhpdf.lib to the project, and put hpdf.h and libhpdf.dll in the project directory. However when I try to debug my code I am getting project link errors returned regarding "Undefined symbols" in libhpdf.lib, do you have any idea what may be causing this? Most likely a silly little error somewhere!

0 Kudos
Message 8 of 19
(4,219 Views)

Well, hpdf.h includes other files that the system must be able to locate. I have placed the Haru library in a folder and added the include subfolder to the search path of the project (Options >> Environment menu item, Include paths button). The file is the last #include in the code.

Do you receive those errors even when running my sample project?

Which version of CVI are you using? I have started using the library with CVI8.5: it should be possibile to use it with previous versions but it may need some adaptation.



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?
0 Kudos
Message 9 of 19
(4,219 Views)

With your sample project I get a different error, it stops at line 16, column 5, reurning a syntax error of "found 'interger constant', expecting '}'."

 

I have also added the include path like you say above.

 

I'm using CVI 2010 (version 10.0.1).

 

Thanks.

0 Kudos
Message 10 of 19
(4,223 Views)