Hallo,
ich möchte mehrere PDF Dokumente in einem Druckauftrag ausgeben.
Ein Beispiel der MBS Sammlung mit CGPDFDocumentMBS habe ich mir angepasst und
das funktioniert sehr gut. Leider ist das Modul nur für macOS. Wie kann ich das auch für
Windows 10 realisieren?
Geht das nur mittels Acrobat? (siehe weiter unten)
macOS Variant:
var PDFData as string = ReadFile(File)
var p as CGPDFDocumentMBS = CGPDFDocumentMBS.CreateWithData(PDFData)
if p<> nil then
if g<>Nil then
g.NextPage
dim c as integer=p.PageCount
for i as integer=1 to c
g.ScaleX = 1
g.ScaleY = 1
g.DrawCGPDFDocumentMBS p, p.CropBox(i), i
if i<c then
g.NextPage
end if
next
Return g
end if
end
Gruß
Klemens
Beispiel aus der MBS Sammlung
#if TargetMachO then
PrintMac true
#elseif TargetWin32 then
dim r as new RegistryItem(“HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe”)
dim s as string = r.DefaultValue
if len(s)=0 then
Break
MsgBox “Failed to find Acrobat Reader.”
else
static sh as shell
sh = new shell
sh.Mode=2
sh.Execute s+" /p "+PDFFile.ShellPath
'sh.Execute s+" /h /p "+f.ShellPath
end if
#else
Break
#endif