globalcitizen / anytopdf

Automatically exported from code.google.com/p/anytopdf
4 stars 1 forks source link

Support for landscape/portrait in .xls docs #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Here's another version of the ConvertAnyToPDF macro that adds the support.
 orientation is 0 for portrait or 1 for landscape.  One problem is that the
first tab in the spreadsheet exports to landscape but other tabs revert to
portrait.

Sub ConvertAnyToPDF(inFile,outFile,orientation)
   inURL = ConvertToURL(inFile)
   oDoc = StarDesktop.loadComponentFromURL(inURL, "_blank", 0,
Array(AnyToPDFMPV("Hidden", True), ))
   outURL = ConvertToURL(outFile)

   dim Printeroptions(0) as new com.sun.star.beans.PropertyValue
   Printeroptions(0).Name = "PaperOrientation"
   Printeroptions(0).Value = orientation
   oDoc.Printer = Printeroptions()

   oDoc.storeToURL(outURL, Array(AnyToPDFMPV("FilterName",
"writer_pdf_Export"), ))
   oDoc.close(True)
End Sub

Original issue reported on code.google.com by aellain@gmail.com on 23 Apr 2009 at 7:58

GoogleCodeExporter commented 9 years ago
Sorry for the delayed response, I'm not really focused on this project anymore 
as it
was more of a one-time hack to solve some issues I was having around automated
document conversion.

Feel free to modify the source and commit a new version if you like, I've given 
you
commit access.

Original comment by walter.stanish@gmail.com on 18 Jul 2009 at 10:23

GoogleCodeExporter commented 9 years ago
Any news?

Original comment by walter.stanish@gmail.com on 10 Dec 2009 at 10:32