Тема: Печать PDF нестандартного формата
Подскажите пожалуйста! нужно напечатать PDF нестандартного формата c помощью Ghostscript.
Чтобы не резались рамки, нужно указывать границы печати ну и галочку вписать. Как это можно указать программно?
Public Sub document_do_PDF_local(ByRef doc As AcadDocument, ByVal openPDF) Dim pages_to_convert As String Dim PtConfigs As AcadPlotConfigurations Dim PlotConfig As AcadPlotConfiguration Dim PtObj As AcadPlot Dim BackPlot As Variant Dim CanMedName As String Dim CanMedNamelist As String Dim mini As Double Dim maxi As Double Dim deltaX As Double Dim deltaY As Double Dim PathDoc As String Dim namedoc As String Dim strnameold As String Dim CanMedNameold As String Dim PaperWidth As Double Dim PaperHeight As Double Dim RetVal Dim oShell Dim prevPrinter Dim temp As String, asd As String Dim list As ACADLayout Dim sBlStampName As String Dim ent As AcadEntity Dim blStamp As AcadBlockReference Dim koljpg As Integer Dim sN As Integer Dim sysVarName As String Dim varData As Variant Set oShell = CreateObject("WScript.Shell") temp = "cmd /c md " & SPD_consts.temp_path RetVal = oShell.Run(temp, 6, True) prevPrinter = ThisDrawing.ActiveLayout.ConfigName koljpg = 0 Dim namelist() As String Dim Count As Integer Dim sLName As String Count = ThisDrawing.ModelSpace.Count Count = ThisDrawing.Layouts.Count sLName = ThisDrawing.ModelSpace.Layout.name Set list = ThisDrawing.ActiveLayout list.GetPaperSize PaperWidth, PaperHeight CanMedNameold = list.CanonicalMediaName Dim sCanonicalNames() As String prevPrinter = ThisDrawing.ActiveLayout.ConfigName Dim strName As String '******* With ThisDrawing BackPlot = .GetVariable("BACKGROUNDPLOT") Set PtObj = .Plot Set PtConfigs = .PlotConfigurations PtConfigs.Add ("Ghostscript") Dim sCanonicalNames_rr() As String Dim plotFileName As String sCanonicalNames_rr = list.GetCanonicalMediaNames Set PlotConfig = PtConfigs.Item("Ghostscript") PlotConfig.ConfigName = "Ghostscript" With PlotConfig '.PlotType = acLayout '.PlotType = acExtents '.PlotType = acLimits .PlotType = acWindow .RefreshPlotDeviceInfo .StandardScale = acScaleToFit .RefreshPlotDeviceInfo End With '******* BackPlot = .GetVariable("BACKGROUNDPLOT") .SetVariable "BACKGROUNDPLOT", 0 strnameold = list.name strName = "ps.ps" plotFileName = "D:\Temp\" + strName PlotDeviceName = "Ghostscript" .Plot.PlotToFile plotFileName, PlotDeviceName plotFileName = "D:\Temp\" + strName .SetVariable "BACKGROUNDPLOT", BackPlot PtConfigs.Item("Ghostscript").Delete Set PlotConfig = Nothing End With '******* temp = "cmd /c \\" & SPD_consts.Server & "\\shared\\gs\\bin\\make_pdf_from_ps.bat " _ & SPD_consts.temp_path & SPD_consts.temp_ps_file_name & " " _ & SPD_consts.temp_path & SPD_consts.pdf_file_name & " " _ & SPD_consts.temp_path & SPD_consts.temp_jpg_file_name & " " _ & openPDF & " " _ & ">" & SPD_consts.temp_path & "pdf.log" RetVal = oShell.Run(temp, 6, True) 'RetVal = oShell.Run(temp, 6, True) Set oShell = Nothing End Sub