Author Topic: concatenate PDF's  (Read 7275 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: concatenate PDF's
« Reply #15 on: March 09, 2016, 03:01:22 AM »
@ ttechnik: You should supply the path to the PDFs. And to merge files you have to specify more than one source file.
Code - Auto/Visual Lisp: [Select]
  1.   (strcat
  2.     "D:/gs/gs918/bin/gswin64 "
  3.     "-dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="
  4.     "D:/Test/merged.pdf D:/Test/a.pdf D:/Test/b.pdf"
  5.   )
  6. )

ttechnik

  • Newt
  • Posts: 24
Re: concatenate PDF's
« Reply #16 on: March 09, 2016, 06:07:26 AM »
Not 64 bit problem.
Great difficulty solved problem.
The target must be complete file path.
Otherwise, not will create.

Code: [Select]
(command "shell"
    (strcat "d:/gs32/gs9.18/bin/gswin32 -dSAFER -dBATCH -dNOPAUSE -q -iDirectories=d:/gs32/gs9.18/bin
-sDEVICE=pdfwrite -sOutputFile=d:/gs32/gs9.18/bin/target.pdf a.pdf b.pdf  ")
  )
« Last Edit: March 09, 2016, 06:11:09 AM by ttechnik »
Tamás Csepcsényi

ttechnik

  • Newt
  • Posts: 24
Re: concatenate PDF's
« Reply #17 on: March 09, 2016, 07:39:29 AM »
What to do in the parameters, file names have spaces?
Tamás Csepcsényi

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: concatenate PDF's
« Reply #18 on: March 09, 2016, 08:29:36 AM »
Will escaping the quote mark work?

Code: [Select]
... -sOutputFile=d:/gs32/gs9.18/bin/target.pdf \"a.pdf\" \"b.pdf\"
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ttechnik

  • Newt
  • Posts: 24
Re: concatenate PDF's
« Reply #19 on: March 09, 2016, 11:08:00 AM »
Not what I meant.

Code: [Select]
(command "shell"
    (strcat (findfile "gs/bin/gswin32.exe") " -dSAFER -dBATCH -dNOPAUSE -q "
                      "-iDirectories=" filesdir " -sDEVICE=pdfwrite "
                      "-sOutputFile=" outputfullfilename " " file1 " " file2)
  )
file2 is "H:\\MT GPON 2015\\KM 002 Mezőkövesd dél (II) INS Turn Key\\__ReKód_13-14-15\\15\\dd-temp"

Which replace the space character strings?
Tamás Csepcsényi

ttechnik

  • Newt
  • Posts: 24
Re: concatenate PDF's
« Reply #20 on: March 17, 2016, 11:22:45 AM »
Here is the solution:

Code: [Select]
(command "shell" (strcat (chr 34) "A:\\support_sajat\\prog_samples\\gs\\bin\\gswin32.exe "
"-dSAFER " "-dBATCH " "-dNOPAUSE " "-q " "-sDEVICE=pdfwrite " (chr 34)
"-sOutputFile=C:\\Users\\Tamás\\Dropbox\\F\\ss.pdf" (chr 34) " " (chr 34)
"C:\\Users\\Tamás\\Dropbox\\FTTH minták\\aa.pdf" (chr 34) " " (chr 34)
"C:\\Users\\Tamás\\Dropbox\\FTTH minták\\ss-temp.pdf" (chr 34)))
Tamás Csepcsényi