Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index

On 28-12-2012 00:48, Hal Vaughan wrote:
I'm exporting ODT files to PDF, but I want to export only 1 page at a time, so I'm using a BASIC 
macro to handle this.

I've been searching, but since somewhere around 3-4am EST, I have not been able to access and most links lead to there.

I can't find examples elsewhere that show me how to export a PDF file from in BASIC or how to 
specify, again, from BASIC, what pages to export.

Can anyone give me links for examples that are not on  Or tell me what classes I 
would be using for this so I can look them up in the IDL to find out how to specify the page (or 
pages) to export and how to use the PDF exporter?

Thank you.


Something like below, to yust save page 3 as 'c:\temp\3.pdf'

How did i get this:
1) Tools/Options/LibreOffice/General: enable "Enable experimental (unstable) features" and "Enable macro recording (limited)"
2) Tools/Macros/Record Macro
3) Save page 3 as pdf via File/Export PDF
4) Click 'Stop recording', and save your macro
5) Via Tools/Macros/Orginize Macros, you should be able to find what you yust saved ;)

REM  *****  BASIC  *****

Sub Main

End Sub

sub testPDF
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")

rem ----------------------------------------------------------------------
dim args1(2) as new
args1(0).Name = "URL"
args1(0).Value = "file:///c:/temp/3.pdf"
args1(1).Name = "FilterName"
args1(1).Value = "writer_pdf_Export"
args1(2).Name = "FilterData"
args1(2).Value = Array(Array("UseLosslessCompression",0,false,,Array("Quality",0,90,,Array("ReduceImageResolution",0,false,,Array("MaxImageResolution",0,300,,Array("UseTaggedPDF",0,false,,Array("SelectPdfVersion",0,0,,Array("ExportNotes",0,false,,Array("ExportBookmarks",0,true,,Array("OpenBookmarkLevels",0,-1,,Array("UseTransitionEffects",0,true,,Array("IsSkipEmptyPages",0,true,,Array("IsAddStream",0,false,,Array("EmbedStandardFonts",0,false,

dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 0, args1())

end sub

For unsubscribe instructions e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.