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

0 Members and 1 Guest are viewing this topic.

ttechnik

  • Newt
  • Posts: 24
concatenate PDF's
« on: March 04, 2016, 03:22:17 AM »
I would like one pdf file, with some laps.
(vla-put-ConfigName activelayout "DWG To PDF_A3L.pc3")
in repeat cicle:
(vla-PlotToFile acadPlot (strcat filedir text_fix "-" (car (nth i Rajzok))))

I would like not to create separate files

Does anyone have any idea?

Tamás Csepcsényi

David Bethel

  • Swamp Rat
  • Posts: 656
Re: concatenate PDF's
« Reply #1 on: March 04, 2016, 06:13:30 AM »

I don't know if it can be done in AutoCAD.

What I do is plot to Postscript files, and have Distiller combine them into a single PDF

It can be automated so that it is a 2 step process

Also ( on my systems at least ) postscript plotting can bypass all prompts and dialog boxes.

-David
R12 Dos - A2K

ttechnik

  • Newt
  • Posts: 24
Re: concatenate PDF's
« Reply #2 on: March 04, 2016, 11:24:20 AM »
Tamás Csepcsényi

Cathy

  • Guest
Re: concatenate PDF's
« Reply #3 on: March 04, 2016, 04:32:07 PM »
Publish allows you the option of a multi-sheet file or single sheet files.  I'm not sure that's an answer to your question though. 

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: concatenate PDF's
« Reply #4 on: March 04, 2016, 06:29:48 PM »
PDF Creator allows you to save each print in a list that can be combined into one file, have been using it for years and works well.
It can also be automated with vba etc.
Might be worth a look.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

ttechnik

  • Newt
  • Posts: 24
Re: concatenate PDF's
« Reply #5 on: March 05, 2016, 01:29:49 PM »
Cathy, the publish is not good. I have one layout and print in program after zoom target.

MickD, from lisp send print to PDF creator?
I do'nt want VB programaing
Tamás Csepcsényi

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: concatenate PDF's
« Reply #6 on: March 05, 2016, 03:12:13 PM »
Use Ghostscript, or something like it, and call it from Autolisp.
Code: [Select]
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf file1.pdf file2.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 #7 on: March 06, 2016, 06:00:32 AM »
THX.

I install the gs9.18.
But I recive: not recognized command.
Tamás Csepcsényi

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: concatenate PDF's
« Reply #8 on: March 06, 2016, 07:41:25 AM »
I agree with Cathy, try with PUBLISH.
The only question is can it be automated with lisp? I don't know anyone ever tried that.
EDIT: I did my research and found BlackBox's publish reactor (I added some stuff and info to it):

Code: [Select]
;Reactor for PUBLISHING (author: BlackBox)
;Reactor starts upon "AUTOMATICPUB" variable is set to 1, and Ctrl+S (quicksave) the drawing
;NOTE: to PUBLISH IN .PDF format go to "Options" -> "Plot and Publish" -> "Automatic Publish Settings", in General DWF/PDF options change "File format" to PDF

    (setq PBCOLLATE (getvar 'PUBLISHCOLLATE))
    (setvar "PUBLISHCOLLATE" 1)

    (setq PBHATCH (getvar 'PUBLISHHATCH))
    (setvar "PUBLISHHATCH" 1)

    (setq PBALLSHEETS (getvar 'PUBLISHALLSHEETS))
    (setvar "PUBLISHALLSHEETS" 1)

    (setq FIELD-EVAL (getvar 'FIELDEVAL))
    (setvar "FIELDEVAL" 4)
 
    (setq AUTOPUB (getvar 'AUTOMATICPUB))
    (setvar "AUTOMATICPUB" 1)

    (setq AUTODWFPUB (getvar 'AUTODWFPUBLISH))
    (setvar "AUTODWFPUBLISH" 0)

;AUTOMATICPUB 0 and ctrl+s
;AUTOMATICPUB 1 and ctrl+s to start the reactor

(vl-load-com)

(defun Autopublish:StartReactor ()


  (or *AutopublishReactor*
      (setq preferences (vla-get-Preferences (vlax-get-acad-object)))
      (setq *AutopublishReactor*
     (vlr-docmanager-reactor
       nil
       '(
(:vlr-documentbecamecurrent . Autopublish:DocumentBecameCurrent)
)
     )
      )
  )
  (princ)
)

(defun Autopublish:DocumentBecameCurrent (rea doc)
  (if (and *AutopublishReactor* (= 1 (getvar 'automaticpub)))
    (prompt (strcat "\n[BlackBox] : AUTOMATICPUB = "
    (itoa (setvar 'automaticpub 0))
    )
    )
  )
  (princ)
)

(Autopublish:StartReactor)

And maybe this would be handy addition:
Code: [Select]
;Toggle the AUTOMATICPUB variable:

(defun c:tgAutoPub (/)
  (if (= (getvar "AUTOMATICPUB") 1)
  (setvar "AUTOMATICPUB" 0)
  (setvar "AUTOMATICPUB" 1)
  )
  (princ (strcat "\nAUTOMATICPUB variable is set to \"" (rtos(getvar "AUTOMATICPUB")) "\" "  ))
  (princ)
)
« Last Edit: March 06, 2016, 08:49:37 AM by Grrr1337 »
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: concatenate PDF's
« Reply #9 on: March 06, 2016, 02:53:01 PM »
THX.

I install the gs9.18.
But I recive: not recognized command.

That's because Ghostscript needs to be in the "environmental path" for Windows before you can use just "gs ...". Otherwise, you will have to use a fully qualified path like: "c:/Ghostscript/bin/gs.exe ..."
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 #10 on: March 06, 2016, 04:53:18 PM »
Yes, John.

I use fully path.

But I have gswin64.exe  and gswin64c, not gs.exe.

Not recognized command....
Tamás Csepcsényi

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: concatenate PDF's
« Reply #11 on: March 07, 2016, 03:04:08 AM »
The executable is named gswin64c.exe instead of gs.exe in your case.

The command line to invoke Ghostscript is essentially the same on all systems, although the name of the executable program itself may differ among systems.

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: concatenate PDF's
« Reply #12 on: March 07, 2016, 09:46:58 AM »
ttechnik, roy_043 is right. You need to call "c:\GS\Ghostscript\bin\gswin64.exe" or rename "gswin64.exe" to "gs.exe".
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 #13 on: March 08, 2016, 02:51:52 PM »
THX to everyone

Code: [Select]
(command "shell"
    (strcat "d:/gs/gs918/bin/gswin64 \" -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -iDirectories=d:/gs/gs918/bin
                 -sOutputFile=a.pdf b.pdf  \"")
)
gs is run, but:
Tamás Csepcsényi

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: concatenate PDF's
« Reply #14 on: March 08, 2016, 03:01:18 PM »
ttechnik, Try the 32 bit version. The 32 bit version should run fine on an x64 machine.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org