Print isometrics in PDF as PDF collection from PLT

images (1)

We will need:

  • GhostScript (link)
  • Plot (placed in %PDMSEXE%\Plot\ + also need %PDMSEXE%\libifcoremd.dll and%PDMSEXE%\libmmd.dll)
  • and .bat file

Installing GhostScript (or take from somewhere : gsdll32.dll and gswin32c.exe)
(Probably for 64-bit version names will be different)
Then create any work directory ( example: D:\Temp\), and inside it, such hierarchy : Прикрепленное изображение: folder_structure.png

In folder 00_gs place binary files of GhostScript’а
In folder 01_plot place: plot.exe, zlib.dll , libifcoremd.dll, libmdd.dll

In that folder root, create .bat file with name create_pdf.bat :

@echo off
setlocal EnableDelayedExpansion EnableExtensions

set currentfolder=%~dp0

set gsexe="%currentfolder%00_gs\gswin32c.exe"
set plotexe="%currentfolder%01_plot\plot.exe"

set inputfolder=%currentfolder%input\
set outputfolder=%currentfolder%output\
set tempfolder=%currentfolder%temp\

rem -- Delete all files from temp and output
del /F /Q %tempfolder%\*
del /F /Q %outputfolder%\*

rem -- Converting PLT files into PS
for /f %%f in ('dir /b %inputfolder%\*') do %plotexe% ps "%inputfolder%%%f" ""

rem -- Converting each PS into PDF (bacause of issue in the PS)
for /f %%f in ('dir /b %tempfolder%\*.ps') do %gsexe% -dSAFER -dBATCH -dNOPAUSE -sPAGESIZE=a1 -sDEVICE=pdfwrite -sOutputFile=%tempfolder%%%f.pdf -dAutoRotatePages=/PageByPage -dPDFFitPage -c "<</Orientation 3>> setpagedevice 0 rotate " -f %tempfolder%%%f

rem -- Gathering PDFs into filelist for GS
set "strGsInput="
for /f %%f in ('dir /b %tempfolder%\*.pdf') do set strGsInput=!strGsInput! "%tempfolder%%%f"

rem -- Merging into the output PDF
%gsexe% -dSAFER -dBATCH -dNOPAUSE -sPAGESIZE=a1 -sDEVICE=pdfwrite -sOutputFile=%outputfolder%output.pdf  -f %strGsInput%

rem -- Delete all files from temp and output
del /F /Q %tempfolder%\*

Now we have everything to create PDF files..
Place inside folder input  our .plt files and run script create_pdf.bat.

As a result inside folder output we will get multipage output.pdf

Thanks to vladimir.degtyar

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.