Creating PDF/X wthe Ghostscript and Purenebasic

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 503
Joined: Tue Oct 14, 2014 12:09 pm

Creating PDF/X wthe Ghostscript and Purenebasic

Post by loulou2522 »

Hi all,
Can someoone know how to generate PDF/X-3 with Purebasic and ghostscript ?
This won't work for creating PDF/X but works for PDF/A

Code: Select all

 ;=========================================                    
    ;pour la mise en place de GHOSTSCRIPT 
    ;===========================================
    CompilerIf #PB_Compiler_Processor = #PB_Processor_x64 
      Lignecommande.s = Chr(34)+path+"gswin64c.exe"+Chr(34)+ Space(1)
    CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x86 
      Lignecommande.s = Chr(34)+Path +"gswin32c.exe"+Chr(34)+ Space(1)
    CompilerEndIf
    
    
    SetEnvironmentVariable("GS_LIB",Path.s)
    SetEnvironmentVariable("GS_DLL",Path.s+"\gsdll32.dll")
    
   
    lignecommande+   "-dPDFX-dBATCH -dNOPAUSE -dPDFSETTINGS=/screen -dNOOUTERSAVE sProcessColorModel=DeviceCMYK  -dUseCIEColor -sColorConversionStrategy=CMYK -sDEVICE=pdfwrite  "
    
    lignecommande+ "-sOutputFile=" +Chr(34)+fichier1$+Chr(34)+ Space(1) 
    lignecommande + Chr(34)+Path+"PDFX_def.ps"+Chr(34)+Space(1)
    lignecommande+ Chr(34)+fichier$+ Chr(34)+Space(1)
    If  CreateFile(0,GetCurrentDirectory()+"pdfx.CMD")
      WriteStringN(0,"@ECHO OFF")
      WriteStringN(0,lignecommande)
      WriteStringN(0,"@ECHO ON")
      CloseFile(0)
    Else 
      MessageRequester("rreur", "Impossibilité de créer le fichier PDF/X",#PB_MessageRequester_Ok|#PB_MessageRequester_Error )
    EndIf 
    
    file$="pdfx.cmd"
       compilateur =    RunProgram( file$,"",""  ,#PB_Program_Wait )