REM wird von der Commandline aufgerufen (per XBase++) REM zusammen mit der Rechnungsdatei cFilehtml REM cRechDir := cDatver + "Scans\Dokumente\" + cAuf + "\_Rechnung\" REM cFilehtml := cRechDir + "R"+cAuf+".html" REM cRechDir & cFilehtml ==>> ThisComponent SUB xRechPDF rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object dim stAuftrag as String dim stRechFile as String rem ---------------------------------------------------------------------- rem get access to the document: document = ThisComponent.CurrentController.Frame stAuftrag = Mid(document.Title,2,6) stRechFile = ThisComponent.URL dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(1) as new com.sun.star.beans.PropertyValue args1(0).Name = "URL" args1(0).Value = Replace(stRechFile, ".html", ".odt") args1(1).Name = "FilterName" args1(1).Value = "writer8" dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1()) rem rem rem F12() 'diese Fkt kommt direkt im Anschluss rem ---------------------------------------------------------------------- REM die PDF-Datei erzeugen: DIM oDoc as Object oDoc = ThisComponent DIM stPrintPDFx as String stPrintPDFx = Replace(stRechFile, ".html", ".pdf") DIM filterArgs(1) as New com.sun.star.beans.PropertyValue filterArgs(1).Name = "SelectPdfVersion" filterArgs(1).Value = 3 DIM arg(1) AS NEW com.sun.star.beans.PropertyValue arg(0).name = "FilterName" arg(0).value = "writer_pdf_Export" arg(1).Name = "FilterData" arg(1).Value = filterArgs oDoc.storeToURL(stPrintPDFx, arg()) wait 2000 rem ---------------------------------------------------------------------- dim stCommand as String dim stProgUrl as String dim stApp as String dim stPDFSource as String dim stXMLSource as String dim stPDFTarget as String stRechFile = Replace(stRechFile, "File:///", "") stProgUrl = "java" stApp = "C:\HDBE\MustangZug.jar" rem stPDFSource = "C:HDBE\R" & stAuftrag & ".pdf" stPDFSource = Replace(stRechFile, ".html", ".pdf") rem stXMLSource = "C:\HDBE\R" & stAuftrag & "_zug.xml" stXMLSource = Replace(stRechFile, ".html", "_zug.xml") rem stPDFTarget = "C:\HDBE\R" & stAuftrag & "_zug.pdf" stPDFTarget = Replace(stRechFile, ".html", "_zug.pdf") IF FileExists(stPDFTarget) THEN kill(stPDFTarget) 'šberschreiben geht sonst nicht mit Mustang wait 2000 stCommand = stProgUrl & " -jar """ & stApp & """ --action combine --source """ & stPDFSource & """ --source-xml """ & stXMLSource &_ """ --format zf --version 2 --profile X --out """ & stPDFTarget & """ --no-additional-attachments" Shell( stCommand, 1, "", true ) end sub rem ---------------------------------------------------------------------- rem ---------------------------------------------------------------------- sub F12 rem ---------------------------------------------------------------------- rem Umstellung auf FontSize 12pt ... rem ... als Voraussetzung, dass PDF-Export richtig geht 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(1) as new com.sun.star.beans.PropertyValue args1(0).Name = "Count" args1(0).Value = 1 args1(1).Name = "Select" args1(1).Value = true dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args1()) rem ---------------------------------------------------------------------- dim args2(2) as new com.sun.star.beans.PropertyValue args2(0).Name = "FontHeight.Height" args2(0).Value = 12 args2(1).Name = "FontHeight.Prop" args2(1).Value = 100 args2(2).Name = "FontHeight.Diff" args2(2).Value = 0 dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, args2()) end sub