Hallo,
Guck mal im Forum unter
viewtopic.php?f=18&t=7619#p29102
Hatte mir gut geholfen.
Gruß Jörg
PDF Export einzelne Seite
Moderator: Moderatoren
Re: PDF Export einzelne Seite
Gruß Jörg
Win 10 Pro AOO 4.1.15
Win 10 Pro AOO 4.1.15
Re: PDF Export einzelne Seite
Hallo nochmal,
vieleicht auch das:
vieleicht auch das:
Code: Alles auswählen
sub PDFspeichern
rem ----------------------------------------------------------------------
sTabName = Thiscomponent.currentcontroller.activesheet.name
msgbox sTabName
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "file:///E:/openoffice/Monatsabrechnungen/2014/" & sTabName & ".pdf"
args1(1).Name = "FilterName"
args1(1).Value = "calc_pdf_Export"
args1(2).Name = "FilterData"
args1(2).Value = Array(Array("UseLosslessCompression",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Quality",0,90,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ReduceImageResolution",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("MaxImageResolution",0,300,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("UseTaggedPDF",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("SelectPdfVersion",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ExportNotes",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ExportBookmarks",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("OpenBookmarkLevels",0,-1,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("UseTransitionEffects",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("IsSkipEmptyPages",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("IsAddStream",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("EmbedStandardFonts",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("FormsType",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ExportFormFields",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("AllowDuplicateFieldNames",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("HideViewerToolbar",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("HideViewerMenubar",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("HideViewerWindowControls",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ResizeWindowToInitialPage",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("CenterWindow",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("OpenInFullScreenMode",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("DisplayPDFDocumentTitle",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("InitialView",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Magnification",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Zoom",0,100,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("PageLayout",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("FirstPageOnLeft",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("InitialPage",0,1,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Printing",0,2,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Changes",0,4,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("EnableCopyingOfContent",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("EnableTextAccessForAccessibilityTools",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ExportLinksRelativeFsys",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("PDFViewSelection",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ConvertOOoTargetToPDFTarget",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("ExportBookmarksToPDFDestination",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("_OkButtonString",0,"",com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("EncryptFile",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("PreparedPasswords",0,,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("RestrictPermissions",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("PreparedPermissionPassword",0,Array(),com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("Selection",0,,com.sun.star.beans.PropertyState.DIRECT_VALUE))
dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 0, args1())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$A$3:$P$160"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())
rem------------------------------------------------------------------
dim args9(0) as new com.sun.star.beans.PropertyValue
args9(0).Name = "ToPoint"
args9(0).Value = "$A$3"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args9())
rem------------------------------------------------------------------------
osheet = thiscomponent.currentcontroller.activeSheet
sNewName = inputbox("Bitte neuen Blattnamen eingeben","Monatswechsel","Neuer Abrechnungsmonat")
osheet.name = sNewName
End Sub
Gruß Jörg
Win 10 Pro AOO 4.1.15
Win 10 Pro AOO 4.1.15
Re: PDF Export einzelne Seite
Hallo,
was mir noch eingefallen ist:
Wenn nicht schon passiert, event. noch den Druckbereich festlegen.
Gruß Jörg
was mir noch eingefallen ist:
Wenn nicht schon passiert, event. noch den Druckbereich festlegen.
Gruß Jörg
Gruß Jörg
Win 10 Pro AOO 4.1.15
Win 10 Pro AOO 4.1.15
Re: PDF Export einzelne Seite
Hi,
so sollte es funktionieren:
Gruß R
so sollte es funktionieren:
Code: Alles auswählen
Sub S_Export_current_active_Sheet_as_PDF_file
Dim myProps(0) as New com.sun.star.beans.PropertyValue
oSheet = Thiscomponent.currentController.activeSheet
sTabname = oSheet.name
osheets = ThisComponent.Sheets
dim APrintareas(osheets.count - 1)
'Druckbereiche löschen
for i = 0 to osheets.count - 1
APrintareas(i) = osheets(i).printareas
if osheet.RangeAddress.Sheet <> i then
osheets(i).setprintAreas(Array())
endif
next i
sURL = Left (ThisComponent.Url, Len(ThisComponent.Url) - 4)+"_"+sTabname+".pdf"
'export PDF
myProps(0).Name="FilterName"
myProps(0).Value = "calc_pdf_Export"
ThisComponent.storetoUrl(sURL,myProps())
'Druckbereiche wieder setzen
for i = 0 to osheets.count - 1
osheets(i).setprintAreas(APrintareas(i))
next i
Thiscomponent.store
msgbox ("Das Tabellenblatt "+sTabname+" wurde erfolgreich in den Quellordner exportiert",64,"aktuelles Tabellenblatt als .pdf exportieren")
End Sub
- miniKasse MMove 1.0.6 Base Videotutorial
- Windows 11: AOO, LO Linux Mint: AOO, LO
Re: PDF Export einzelne Seite
Ich gehe mal davon aus, du nutzt die Grafischen Schaltflächen aus den Formular-Steuerelementen (unter "weitere Steuerelemente"). Die Steuerelemente haben alle eine Eigenschaft "druckbar". Kannst du über das Kontextmenü > Kontrollfeld... > Allgemein editieren. Dann werden sie nicht mehr mitgedruckt.Huutsch hat geschrieben:In meinem Fall verschiebe ich die Images, mit denen ich die Makros auf der Seite starte, aus dem Duckbereich, weil ich sie nur für die Bedienung möchte, nicht aber auf dem Papier.
Wenn der Druckbereich gelöscht ist, dann erscheinen sie trotzdem auf dem Papier, weil OO dann alles druckt, was nicht leer ist.
System:
LibO 6 + LibO 7
LibO 6 + LibO 7