PDF Export via LISP

Topics relating to AutoLisp and SDS.

Moderators: CMS Inc, avaernes

Post Reply
timg
Newbie
Posts: 7
Joined: Sun Mar 13, 2005 11:01 pm
Location: San Jose, CA, USA

PDF Export via LISP

Post by timg » Wed Oct 14, 2009 2:02 pm

Not a lot of traffic here, but I'll give it a try...

I wish to export a drawing I have created via lisp as a PDF file. In theory the code below should work, but what I get is the default DWG format instead. Anyone got any ideas? Is this a bug?

; (load "pout")
(defun C:pout ()
(command "export" "c:\\mypdf.pdf")
)

FOrgot to mention, I'm using CMS ICAD v6.6 Pro
CAD_B
Valued Contributor
Posts: 27
Joined: Sun Jun 20, 2004 11:01 pm

Post by CAD_B » Thu Oct 15, 2009 4:20 pm

Not sure about this, but instead of EXPORT try PDFOUT.
timg
Newbie
Posts: 7
Joined: Sun Mar 13, 2005 11:01 pm
Location: San Jose, CA, USA

PDF Export

Post by timg » Wed Oct 21, 2009 12:36 pm

No, PDFOUT and PDFEXPORT are not commands. Looks like this is an on-going bug, I've seen it since 6.2
CAD_B
Valued Contributor
Posts: 27
Joined: Sun Jun 20, 2004 11:01 pm

Post by CAD_B » Wed Oct 21, 2009 1:08 pm

Sorry I was no help. I use a different brand of Intellicad (Cadopia) that has the PDFOUT command in their recent release. The only suggestion I have is that you could possibly use an external PDF converter program (there are many) and call it from within your lisp. I presume CMS Icad has STARTAPP or SHELL or something to call a windows program. I have successfully made external calls in Autolisp by using FINDFILE within a loop to check for the existence of the new file. Good luck.
User avatar
CMS Inc
Site Admin
Posts: 91
Joined: Wed Feb 23, 2005 12:01 am
Location: Burleson, TX
Contact:

Post by CMS Inc » Wed Oct 21, 2009 1:37 pm

CMS IntelliCAD 6.6 HAS PDF EXPORT OPTION
timg
Newbie
Posts: 7
Joined: Sun Mar 13, 2005 11:01 pm
Location: San Jose, CA, USA

PDF Export

Post by timg » Wed Oct 21, 2009 3:08 pm

Thanks for both replies:
Admin - The EXPORT PDF function is not available via LISP. EXPORT C:\\MyDwg.pdf produces a DWG file, please see above.

CAD_B - I had been using Print and GhostScript to create a PDF, however v6.6 seems to have changed how Print sizes are stored and it now will not remember what I have set - This probably needs to be a new thread.
JCAMPOS

Post by JCAMPOS » Thu Oct 22, 2009 4:05 am

timg,

CMS IntelliCAD 6.6 will remember the print configurations (Print Area, Print Scale, Print Style Table, Print Offset, etc.) if "Save Changes to Layout" is checked for Current Layout (Print dialog).

To use an external application via LISP call the function startapp with its arguments. For instance, (startapp "notepad" "C:\\TEMP\\SomeText.txt").

Thank you,
JCAMPOS
timg
Newbie
Posts: 7
Joined: Sun Mar 13, 2005 11:01 pm
Location: San Jose, CA, USA

Post by timg » Thu Oct 22, 2009 11:44 am

Thanks for the reply JCAMPOS, I think I didn't express my problem very well. I have been able to save the general layout, it is the print Setup that is giving me problems.

I use Ghostscript with a port re-direct to create PDF files (PDF export doesn't seem to cope well with viewports the way I am using them) Anyway, when I use this "Printer" in other programs, no problem, but in IntelliCAD in keeps defaulting to 11x17 paper size. How can I set the correct paper size? I usually set it at Legal and that works fine for me.

These print-outs are automatically generate via LISP, I don't want to have to keep an eye on it and change the settings every time.
Userlevel6
Valued Contributor
Posts: 31
Joined: Tue Sep 18, 2012 11:44 am

making PDFs

Post by Userlevel6 » Wed Jun 05, 2013 1:10 pm

for what it's worth, I suggest installing a PDF printer emulator (for example PDF995), then using it as you would any other Windows system printer.

I've found this method to be easier to control the lineweights and other variables involved in getting a good quality PDF.
Post Reply