DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Export to PDF appending issues

Solved!
Go to solution

Recently, since switching to DIAdem 2019, I have been having trouble with using the Report.Sheets.ExportToPDF(path, append = true) where I set the appending option to true.  The resulting appended file is corrupt many time.  I have done a little bit of troubleshooting, and seems pretty random and mostly happens if there are more than 3 sheets and not always on the first append.  Does anyone else experience this?  The file won'nt open in adobe or any other pdf viewer.

For troubleshooting, if I simply run the following code as soon as I open DIAdem to make 4 appended pages of the example TDR loaded, the file is corrupt:

Option Explicit  'Forces the explicit declaration of all the variables in a script.

DIM PATH, NAME
PATH = "C:\Users\111660\Downloads\"
NAME = "example"
Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE)
Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE)
Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE)
Call Report.Sheets.ExportToPDF(PATH & NAME & ".pdf", TRUE)

diadem 2019.JPGpdferror.JPG

0 Kudos
Message 1 of 7
(2,946 Views)

Hi gsklyr,

To create a PDF in DIAdem you have two options: a) using the PDF printer which is installed with DIAdem and b) on W10 using PDF printer installed with the OS.

  1. a) can append PDF files but need the option “Output to printer with transparency” to print a layout with transparence objects.
  2. b) can directly print a layout with transparence objects but is not able to append PDF files.

Please can you check your DIAdem REPORT settings?

grafik.png

 

Greetinsg

Walter

0 Kudos
Message 2 of 7
(2,860 Views)

Capture.JPG

I'm on W7 so the "create PDF files with Microsoft printer" seems to be unavailable 

0 Kudos
Message 3 of 7
(2,839 Views)

Hi gsklyr,

 

You're right, the "Create PDF files with Microsoft printer" configuration in REPORT first became available when installed on Windows 10, since that was the first Windows version that shipped with a compatible PDF printer.

 

I can reproduce the error you report with my DIAdem 2019 on Windows 10, as long as I use the default DIAdem PDF printer, although it only happens with some layouts.  I actually have to delete the default REPORT layout after first starting DIAdem 2019-- that "empty white sheet of paper" results in an unreadable *.pdf file.  If I leave the default REPORT layout after a clean restart, I get 4 pages of that default layout in my Adobe PDF Reader.

 

I'm chatting with R&D about this and will report back when I know more,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 7
(2,822 Views)

Hi gsklyr,

 

R&D has been able to also reproduce this issue, thanks to your recipe.  They are investigating this now.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 7
(2,800 Views)
Solution
Accepted by topic author gsklyr

Hi gsklyr,

 

I just learned that there was an update to the "DIAdem PDF Printer" with DIAdem 2019, and this has introduced this intermittent append problem.  While R&D considers addressing this in a subsequent DIAdem release, may I suggest 2 possible workarounds?

 

1) If you have DIAdem 2018 also installed on that computer, you can run the "DIAdemSTART.exe" from the 2018 DIAdem folder to clobber the 2019 DIAdem PDF Printer with the 2018 DIAdem PDF Printer.  That should then make your DIAdem 2019 call the 2018 PDF Printer.

 

2) If you happen to be using PDF-appending because you want to print only certain pages of a layout, you could instead mark the desired pages prior to printing and then print just those pages out without invoking appending.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 7
(2,788 Views)

I just don't use the append function for now and have separate uniquely named reports for the same test ran on the same unit.  Thanks for the investigation, hope this clears it for others who started encountering strange pdf behavior.

0 Kudos
Message 7 of 7
(2,778 Views)