Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Excel saving as PDF as 1 page

by soonix (Canon)
on Oct 24, 2015 at 21:01 UTC ( [id://1145861]=note: print w/replies, xml ) Need Help??


in reply to Excel saving as PDF as 1 page

Can't test this now, but ISTR it should be
$sheet->PageSetup->{FitToPagesWide} = 1; $sheet->PageSetup->{FitToPagesTall} = 1;
Otherwise it's interpreted as method call instead of attribute access.

Replies are listed 'Best First'.
Re^2: Excel saving as PDF as 1 page
by merrymonk (Hermit) on Oct 24, 2015 at 21:34 UTC
    Thank you. This did not give any failure messages.
    Sadly it did not work as the PDF file was written to two pages. Have you any idea how to make it use just one page?
      try
      use Win32::OLE qw(with); use Win32::OLE::Variant; my $vtfalse = Variant(VT_BOOL, 0); my $vtpages = Variant(VT_I4, 1); with ($sheet->PageSetup, 'Zoom' => $vtfalse, 'FitToPagesWide' => $vtpages, 'FitToPagesTall' => $vtpages );
      poj
        Brilliant. That works just as I wanted it to. Thank you for your help. It was good to find it first thing this morning.
        (This is a reply to your latest comment)
        Brilliant. That works just as I wanted it to. Thank you for your help. It was good to find it first thing this morning.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1145861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-16 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found