See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Adobe PDF - fill name without pop-up

  1. #1
    Member
    Join Date
    2022-10
    Posts
    12
    Login to Give a bone
    0

    Default Adobe PDF - fill name without pop-up

    Hi there,
    I'm adjusting tool for printing of PDFs. I am forced to use (per department standard) Adobe PDF printer. Is there a way to fill/avoid that pop-up window and instead fill this information via LISP?


    Previously in different company I had macro that would work with "DWG To PDF" printer, where when asked for name, I would give desired folder and filename depending on multiple factors - usually project number and type of drawing, which I got from getting file path and some other such informations adjusted in LISP. However with Adobe PDF it seems to completely ignore input on AutoCAD side to give filename and filepath via lisp.
    Attached Images Attached Images

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    You could create a reactor that executes a routine when the plot command is started. That routine can calculate the desired PDF filename and send it to the clipboard for pasting into the file name box.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    I don't know if the Adobe dialog will respond to setting filedia = 0, but its worth a try.
    C:> ED WORKING....


    LinkedIn

  4. #4
    Member
    Join Date
    2022-10
    Posts
    12
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    Quote Originally Posted by Ed Jobe View Post
    I don't know if the Adobe dialog will respond to setting filedia = 0, but its worth a try.
    Nope, ignores it and still opens the window.
    It feels it is separated from Acad, so inputing with LISP might be just impossible.

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    That's what I suspected. By the time, the Adobe dialog pops up, AutoCAD has turned over processing to the external app.
    C:> ED WORKING....


    LinkedIn

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    Quote Originally Posted by Ed Jobe View Post
    That's what I suspected. By the time, the Adobe dialog pops up, AutoCAD has turned over processing to the external app.
    That is why I suggest a reactor before the plot command starts to create and place the preferred naming convention into the Windows Clipboard.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,665
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    Quote Originally Posted by NalkCZ View Post
    Hi there,
    I'm adjusting tool for printing of PDFs. I am forced to use (per department standard) Adobe PDF printer. Is there a way to fill/avoid that pop-up window and instead fill this information via LISP?
    I have Page Setups for every size layout and one for PDF for each of them as well with " PDF" added to the name so "11×17" for the hardcopy and "11×17 PDF" for the PDF file.

    Checked and even with Page Setup set to Adobe PDF I do not get any dialog box plotting the current layout to PDF in the drawing's folder using macro ^C^C^P(pdfPlot) using the following code as long as it's not already open in Adobe:
    Code:
    (defun getCurrentPagesetup (layout / lst PSname PSdim data)
      (setq lst (dictsearch (namedobjdict) "acad_layout")
      		lst (dictsearch (cdar lst) layout)
      )
      (setq
    		PSname (cdr(assoc 1 lst))
    		lst (member '(100 . "AcDbPlotSettings") lst)
    		data (cadr lst)
    		PSdim (PaperSize)
      )
      (princ "\nPSdim = ")(princ PSdim)
      (princ "\n")
      (cond
    	((= PSdim "8½×11")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "8½×11" "8½×11 PDF")))); .regen
    	)
    	((= PSdim "11×8½")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "11×8½" "11×8½ PDF")))); .regen
    	)
    	((= PSdim "8½×14")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "8½×14" "8½×14 PDF")))); .regen
    	)
    	((= PSdim "14×8½")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "14×8½" "14×8½ PDF")))); .regen
    	)
    	((= PSdim "11×17")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "11×17" "11×17 PDF")))); .regen
    	)
    	((= PSdim "18×24")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "18×24" "18×24 PDF")))); .regen
    	)
    	((= PSdim "24×36")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "24×36" "24×36 PDF")))); .regen
    	)
    	((= PSdim "22×34")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "22×34" "22×34 PDF")))); .regen
    	)
    	((= PSdim "34×22")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "34×22" "34×22 PDF")))); .regen
    	)
    	((= PSdim "36×48")
    	  (Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "36×48" "36×48 PDF")))); .regen
    	)
    	(T (princ "\nDrawing not saved!"))
      )
      (SetCurrentPageSetup (vla-get-activedocument (vlax-get-acad-object)) PSdim)
      (PaperSize)
    )
    
    (defun QuickPlot ( / CPgSetup pathPDF)
      (setq CPgSetup(getCurrentPagesetup (getvar "ctab"))
            pathPDF (strcat (getvar "DWGPREFIX")(vl-filename-base (getvar "dwgname"))" - "(getvar "ctab"))
      )
      (if CPgSetup
    	(progn
    	  (vl-file-delete (strcat CPgSetup))		;http://forums.augi.com/showthread.php?173337-Check-if-PDF-is-open-Delete-if-not&p=1341076&viewfull=1#post1341076
    	  (command "_.-PLOT" "No" ""  ""  "" "" "" "Yes")
    	  (if (> (getvar "cmdactive") 0)
    		(progn
    		  (command "No")
    		  (princ (alert (strcat pathPDF " cannot be plotted because it's Open in Adobe Acrobat!")))
    		)
    		(princ (strcat pathPDF " saved."))
    	  )
    	)
      )
      (princ)
    )
    
    (defun pdfPlot ( / CPgSetup pathPDF)
      (setq CPgSetup(getCurrentPagesetup (getvar "ctab"))
            pathPDF (strcat (getvar "DWGPREFIX")(vl-filename-base (getvar "dwgname"))" - "(getvar "ctab"))
      )
      (if CPgSetup
    	(progn
    	  (vl-file-delete (strcat CPgSetup " PDF"))		;http://forums.augi.com/showthread.php?173337-Check-if-PDF-is-open-Delete-if-not&p=1341076&viewfull=1#post1341076
    	  (or(vl-string-search " PDF" CPgSetup)(setq CPgSetup(strcat CPgSetup " PDF")))
    	  (command "_.-PLOT" "No" "" CPgSetup "" pathPDF "No" "Yes")
    	  (if (> (getvar "cmdactive") 0)
    		(progn
    		  (command "No")
    		  (princ (alert (strcat pathPDF " cannot be plotted because it's Open in Adobe Acrobat!")))
    		)
    		(princ (strcat pathPDF " saved."))
    	  )
    	)
      )
      (princ)
    )
    While it includes calls to Lee Mac's Steal from Drawing to import Page Setups from my template drawing it's not required if the Page Setups are already in the drawing.

  8. #8
    Member
    Join Date
    2022-10
    Posts
    12
    Login to Give a bone
    1

    Default Re: Adobe PDF - fill name without pop-up

    Luckily after some back and forth I found out that the team was never supposed to be using Adobe PDF for printing but instead default DWG to PDF. And that one is easy to work with LISP.
    Thank you all for ideas, maybe some other hapless user will find them helpful when in need.

  9. #9
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    559
    Login to Give a bone
    1

    Default Re: Adobe PDF - fill name without pop-up

    To Tom

    Its possible to just read the title block in each layout and plot correctly, I have done this for a client recently the title block in a layout is used to set a WINDOW plot area all titles are at 1:1 true size works for landscape and portrait sizes as window is just set correct.

    Click 1 button on a menu and watch the pdfs come out.

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,665
    Login to Give a bone
    0

    Default Re: Adobe PDF - fill name without pop-up

    Quote Originally Posted by BIG-AL View Post
    To Tom

    Its possible to just read the title block in each layout and plot correctly, I have done this for a client recently the title block in a layout is used to set a WINDOW plot area all titles are at 1:1 true size works for landscape and portrait sizes as window is just set correct.

    Click 1 button on a menu and watch the pdfs come out.
    For binding plans the left margin has to be larger. I know one firm that adds points so they can plot to extents with the added left margin but everyone else uses layout for plotting. Don't think it would be possible to use WINDOW to Publish selected layouts in a drawing.

    For the current layout I have one button for quick plotting and another for quick PDF into the drawing folder.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 2013-01-28, 12:52 PM
  2. Replies: 12
    Last Post: 2010-01-08, 07:49 PM
  3. PDFing without Adobe
    By brian104662 in forum Revit Architecture - Tips & Tricks
    Replies: 2
    Last Post: 2008-02-11, 04:05 PM
  4. Individual PDF's from a Sheet set? (Adobe PDF)
    By JasonSelf in forum Software
    Replies: 2
    Last Post: 2007-09-18, 03:27 PM
  5. Adobe PDF vs Acad PDF file size info.
    By madcadder in forum AutoCAD Plotting
    Replies: 2
    Last Post: 2006-11-30, 06:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •