DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Specifying page size using pdfexport()

I have been trying to specify a specific page size for a PDF.  I have figured out how to use the picratio and other variables to change the TDR within DD.  However, the PDFexport ignores the printwidth setting and always uses 8.5x11.

 

I was able to manually change the page size by printing to the "diadem pdf printer" but i need scripted solution.

 

Is there a way to use the picprint and "printname" variable to specify a page size?

 

something like

 

printname = "diadem pdf printer,LPT1,11x17"

 

Here is what doesn't work

 

dim w,h

PicInScal = False ' relative positioning

PicFrame = False ' we'll handle the frame ourselves

w=11

h=17

picratio= h/w

PicwidthInScal = w-0.5

PicHeightInScal = h-0.35

PrintTopMarg = 0.17 ' top page page

PrintLeftMarg = 0.25 ' left page margin

PrintWidth = w ' page width

CALL PICpdfexport(PATH)

 

Jim West

0 Kudos
Message 1 of 10
(5,638 Views)

Hey Jim,

 

After trying several variations, I don't think this is going to be possible.  I seemed to get programmatic export to PDF to work after script recording myself manually exporting the PDF with my chosen settings and then immediately running the recorded script, but that's all.  Other than that, though I can seem to set the side of the TDR in DIAdem itself, it always seems to generate a PDF of standard size. 

 

I will file feedback to the DIAdem R&D team to take a look at this for a future release of DIAdem.  Thanks for providing this feedback, Jim.

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 2 of 10
(5,602 Views)

Can you look at the 11.1 beta and see if it works there?

 

jim

0 Kudos
Message 3 of 10
(5,599 Views)

Hey Jim,

 

You're a step ahead of me!

 

I copied and pasted your exact code (save for the fact that I added an absolute path to the PICPDFExport command) into the DIAdem 11.1 beta and ran it.  The attached PDF is what I got as an output.  Is that what you were looking for?  Note that I used, simply, the example TDR, so things are a little out-of-whack in terms of design and layout.  I am using Adobe Acrobat 8.1.5.

Message Edited by DRock on 06-02-2009 12:00 PM
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 4 of 10
(5,596 Views)

Yes, that is what I want but in V11.0 Smiley Wink

 

jim

0 Kudos
Message 5 of 10
(5,588 Views)

Hi Jim,

 

For DIAdem 11.1 we done several improvements in the context of PDF.

In DIAdem 11.0 I've tested the following:

 

dim w,h

PicInScal = False ' relative positioning
PicFrame = False ' we'll handle the frame ourselves

w=11
h=17
picratio= h/w
PicwidthInScal = w-0.5
PicHeightInScal = h-0.35
PrintTopMarg = 0.17 ' top page page
PrintLeftMarg = 0.25 ' left page margin
PrintWidth = w ' page width


call PrintMaxScale


CALL PICpdfexport("D:\Test\ttt")



It seems to work.

 

Greetings

Walter

0 Kudos
Message 6 of 10
(5,572 Views)

I still can't get this to work.  I have 11.1 beta.  I have copied the script from prior posts.

 

Diadem shows the correctly sized report but when the PDF export is made; the report is jammed into 8.5x11.  Sample attached

 

I have adobe reader 9.1.1

 

jim

 

dim w,h

PicInScal = False ' relative positioning

PicFrame = False ' we'll handle the frame ourselves

w=28

h=11

picratio= h/w

PicwidthInScal = w-0.5

PicHeightInScal = h-0.35

PrintTopMarg = 0.17 ' top page page

PrintLeftMarg = 0.25 ' left page margin

PrintWidth = w ' page width

 

call PrintMaxScale

CALL PICUPDATE

CALL PICpdfexport("C:\Development\Spartan\www\temp\test3.pdf")

Download All
0 Kudos
Message 7 of 10
(5,521 Views)

Hey Jim,

 

I updated my Adobe Acrobat reader to 9.1.2 (I was using 8.1.6) and used the exact same script commands that Walter posted above.  In both DIAdem 11.0 and DIAdem 11.1 using that script and that script alone, I get a resulting PDF that is 11x17.

 

Could you try replicating that exact process?

  1. Update Adobe to match  me, if possible.
  2. Open up a new script and copy/paste Walter's exact commands.  Use nothing else in the SCRIPT.  Use our default example REPORT template.
  3. Run the script and view the resultant PDF.

I'd like to see if simplifying the process by using a script that contains only Walter's commands and our default example TDR yields the same results, as this is the test that I successfully ran. 

 

Let me know?

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 8 of 10
(5,494 Views)

I did as you suggested and it didn't work.  However, I know why yours works.

 

I had a wild idea that using the manual Diadem PDF printer will affect the script output. 

 

I did this process:

  1. Ran the script on example TDR  --> got 8.5x11 output
  2. Manually printed
    1. File Menu ->Print
    2. Select "Printer...'
    3. Select "DIAdem PDF Export"
    4. Select 11x17
    5. press OK
    6. Press Min Borders
    7. Press OK
    8. Enter  file name
    9. Confirmed 11x17 size
  3. Ran the script again on example TDR --> got 11x17 output

If you look at your current "diadem PDF export" printer settings, I bet they are 11x17.

 

Better yet, I bet if you change the size in your script, you will still get 11x17.

 

Jim

0 Kudos
Message 9 of 10
(5,488 Views)

Hey Jim,

 

I think we're going to have to use that as a workaround until R&D can investigate this further.  As a result of this post, they are aware of the behavior you've been seeing.

 

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 10 of 10
(5,442 Views)