Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp routine to print pdf

19 REPLIES 19
Reply
Message 1 of 20
Anonymous
3954 Views, 19 Replies

Lisp routine to print pdf

Does anyone have a lisp routine to print pdf and save it on local drive D (D:\TEMP)? I have a lisp but it prints .plt file.
(defun c:PDF()
(command "tilemode" "0")
(command "-plot" "y" "" "CutePDF Writer.pc3" "ISO A1" "m" "L" "N" "e" "1:1" "0.0,0" "Y" "acad.ctb" "Y" "N" "N" "N" "Y" (strcat "D:\\Temp\\" (getvar "dwgname")) "y" "Y")
)

Thanks,
Johny
19 REPLIES 19
Message 2 of 20
Anonymous
in reply to: Anonymous

I don't know how CutePDF Writer works, but if you have AutoCAD 2007 or
higher, you can use the built-in Dwg To PDF.pc3 to create your PDF:

(defun c:PDF()
(command "tilemode" "0")
(command "-plot" "y" "" "Dwg To PDF.pc3" "ISO A1 (841.00 x 594.00 MM)" "m"
"L" "N" "e" "1:1" "0.0,0" "Y" "acad.ctb" "Y" "N" "N" "N" (strcat
"D:\\Temp\\" (getvar "dwgname")) "y" "Y")
)

Paul

wrote in message news:6236806@discussion.autodesk.com...
Does anyone have a lisp routine to print pdf and save it on local drive D
(D:\TEMP)? I have a lisp but it prints .plt file.
(defun c:PDF()
(command "tilemode" "0")
(command "-plot" "y" "" "CutePDF Writer.pc3" "ISO A1" "m" "L" "N" "e" "1:1"
"0.0,0" "Y" "acad.ctb" "Y" "N" "N" "N" "Y" (strcat "D:\\Temp\\" (getvar
"dwgname")) "y" "Y")
)

Thanks,
Johny
Message 3 of 20
Anonymous
in reply to: Anonymous

Thanks for your immediate reply. But I'm using Cute Pdf printer for creating pdfs.
Johny
Message 4 of 20
Anonymous
in reply to: Anonymous

Don't think it can be done using Cute PDF because they have there own dialog
box which can't be fed from lisp
(At least I've never found a way).
Message 5 of 20
Anonymous
in reply to: Anonymous

Acro Software, the company behind Cute PDF sells a programmatic access
package (whose kernel is the same CutePDF) which is one time fee payment of
about 700$ which gives you the right to a custom virtual PDF printer with
what ever name you want (what about your company name), which you can
install on whatever number of machines you want (we have close to a couple
of hundreds).

This package is controllable through registry keys, so in house
customization can be done even with VisalLISP. Technical support is pretty
decent.

Otherwise, as you say, CutePDF can't be controlled and fed from LISP (and
from no other language), because it's not exposed in any way.

--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.


"Jason Rhymes" <@> a écrit dans le message de news:
6236868@discussion.autodesk.com...
Don't think it can be done using Cute PDF because they have there own dialog
box which can't be fed from lisp
(At least I've never found a way).
Message 6 of 20
Anonymous
in reply to: Anonymous

Didn't know that, interesting.
Thanks for sharing that info.
Message 7 of 20
Anonymous
in reply to: Anonymous

You're welcome.


--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.


"Jason Rhymes" <@> a écrit dans le message de news:
6237027@discussion.autodesk.com...
Didn't know that, interesting.
Thanks for sharing that info.
Message 8 of 20
Anonymous
in reply to: Anonymous

Most of the virtual printer drivers, like CutePDF, are limited to common printer sizes. 11x17 or A3 being the largest document you can generate. If you need a document that is "D" or A0 size, you are limited to a reduced, lo-rez output. I would use the Autodesk driver.
Message 9 of 20
Anonymous
in reply to: Anonymous

The problem with Autodesk drivers is the text comes in as graphics and is
not searchable.
Message 10 of 20
Anonymous
in reply to: Anonymous

Try using True Type fonts, instead of .SHX fonts, in your drawing. I know when I generate a Postscript file first, then convert the Postscript file to a .PDF, fonts such as Arial remain text in the PDF, but .SHX fonts come out as vector graphics.
Message 11 of 20
Anonymous
in reply to: Anonymous

I do use TTF but never went the PS?? route. What extra software is needed to
do this?
Message 12 of 20
Anonymous
in reply to: Anonymous

Sorry, but I don't know. At my present and past employers, they had a server running the conversion software. You place the PS file into an in folder (often for a specific drawing file size) and the PDF comes out of the out folder. This method for generating PDFs is old, 6+ years, and before Autodesk included the built in PDF driver. I generally prefer the PS method because it creates smaller file sizes and it will work with files that are too large for the built in one. I'm sure it's a commercial product, possibly from Bently (pardon my French). I'm sure it's not free.
Message 13 of 20
Anonymous
in reply to: Anonymous

It's Adobe's Acrobat Distiller. (The server is in the cubical next to me.)
Message 14 of 20
MorganMcGuire
in reply to: Anonymous

I've been printing A1 & A2 sizes on my CutePDF driver for a while now.

You just need to add the page name and sizes in the "Server Properties" part of Printers & Faxes area. I think I had to delete the existing sizes and recreate it for them to display in the CutePDF. You'll have to override the existing pc3 file if you have one.

ie, In Printers and Faxes --> File --> Server Properties --> Check "Create New Form" and input values.

Morgan.
Message 15 of 20
Anonymous
in reply to: Anonymous

Is there any way to suppress the save file dialog box?

(setvar "filedia" "0")
(command "tilemode" "0")
(command "-plot" "y" "" "CutePDF Writer.pc3" "ISO A1" "m" "L" "N" "e" "1:1" "0.0,0" "Y" "acad.ctb" "Y" "N" "N" "N" "Y" "y" "Y" (strcat "D:\\Temp\\" (getvar "dwgname")))
)
Message 16 of 20
Anonymous
in reply to: Anonymous

I don't know where do you this information from, but this is totally wrong
and untrue, as you can see in the attached image.

--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.


a écrit dans le message de news:
6237039@discussion.autodesk.com...
Most of the virtual printer drivers, like CutePDF, are limited to common
printer sizes. 11x17 or A3 being the largest document you can generate. If
you need a document that is "D" or A0 size, you are limited to a reduced,
lo-rez output. I would use the Autodesk driver.
Message 17 of 20
Anonymous
in reply to: Anonymous

I stand corrected on CutePDF on generating larger print sizes. In the past I have tried to use virtual printer drivers to create bit map images and the freebies would be limited to smaller print sizes. Which, for my purposes at the time were not sufficient. I know the version of Microsoft Office Document Image Writer I have, has such a limitation. Edited by: anim8er_gie on Aug 14, 2009 1:17 PM
Message 18 of 20
Anonymous
in reply to: Anonymous

(initdia 0) ? have you tried this? have no idea if this would work but it
might be worth a try
"johnypd" wrote in message news:6237149@discussion.autodesk.com...
Is there any way to suppress the save file dialog box?

(setvar "filedia" "0")
(command "tilemode" "0")
(command "-plot" "y" "" "CutePDF Writer.pc3" "ISO A1" "m" "L" "N" "e" "1:1"
"0.0,0" "Y" "acad.ctb" "Y" "N" "N" "N" "Y" "y" "Y" (strcat "D:\\Temp\\"
(getvar "dwgname")))
)
Message 19 of 20
Anonymous
in reply to: Anonymous

hello my friends,
I'm actually looking for something very similar to what my friend John has. the diference is that I do want to use the DWG to PDF.pc3 file. Also I want to plot multple files at the same time. and like John I need them in C:/BATCH. I need to convert to pdf full size in inches and not mm. 30x42 for example.

Would you hook me up with this one please? I'll sure appreciate it.
thanks
rheredia
Message 20 of 20
nislam04
in reply to: Anonymous

Hello Salamu Alaikum,

I hope all of  you are doing fine.

My question is; how can I use "Adobe PDF" (Not Adobe PDF.pc3) in place of "Dwg To PDF.pc3" please. I tried but it does not work.

 

Any help please...

 

Thank  you.

Actually I want to make the change here:

(defun C:test ( / cmd )
(setq cmd (getvar 'cmdecho)) (setvar 'cmdecho 0)
(foreach Layout (layoutlist)
(command "_.-PLOT"
"No" ; Detailed plot configuration? [Yes/No] <No>: No
Layout ; Enter a layout name or [?] <Layout1>:
"" ; Enter a page setup name
"DWG To PDF.pc3" ; Enter an output device name or [?] <DWG To PDF.pc3>:

(strcat (getvar "DWGPREFIX") (vl-filename-base (getvar 'DWGNAME)) Layout ".pdf") ; Directory to save

"No" ; save changes to page setup?
"Yes" ; proceed with plot?
); command

); foreach
(setvar 'cmdecho cmd)
(princ)
); defun C:test

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost