VBA Code to convert .DWG (with all layouts) to a single .PDF file.

VBA Code to convert .DWG (with all layouts) to a single .PDF file.

Anonymous
Not applicable
2,890 Views
9 Replies
Message 1 of 10

VBA Code to convert .DWG (with all layouts) to a single .PDF file.

Anonymous
Not applicable

I would like VBA to convert all layouts in drawing to single .PDF file.

Now I can convert it to PDF file with separate PDF files, but not know process to convert to a Single PDF file with all .DWG layouts.

 

aunna;

 

0 Likes
2,891 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

From Publish u can plot multiple layouts to single PDF.

0 Likes
Message 3 of 10

amy.mccall
Participant
Participant

Piggy-backing on this, is there a way to export all layouts from an AutoCAD file to a single PDF? I have been able to create separate PDF's for each layout but I would like to create a single PDF which includes all of the layouts combined. 

0 Likes
Message 4 of 10

pendean
Community Legend
Community Legend

@amy.mccall wrote:

is there a way to export all layouts from an AutoCAD file to a single PDF? 


PUBLISH command, single PDF output anytime you want it.

0 Likes
Message 5 of 10

cadffm
Consultant
Consultant

Hi,

 

I don't know a way by VBA API (I am not a vba programmer), but

 

a) you can use a pdf driver what offers a commandline interface (or API) and multipage feature

    Send the set multipage on to your pdf driver, plot your layouts, send the "end&create PDF" command to the pdf driver

 

or

 

b) create single pages and use another external program what offers a commandline interface (or API)

    and send the "merge" command after single pdfs created

 

or

 

c) use the AutoCAD publish command. By VBA you can create the *.dsd you need and then run the -publish command with your created .dsd file.

Sebastian

0 Likes
Message 6 of 10

Ed__Jobe
Mentor
Mentor

I don't know what happened to my reply and amy's reply to mine, but Sebastian is right. The publish command processes the pdf's after they are created and merges them into one pdf. Neither the vba api or NET api have pdf processing (that is, as part of the acad api). As Sebastian suggested, you would either have to do it manually, or find a program that has an api that you can reference in your project.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 7 of 10

maratovich
Advisor
Advisor

@amy.mccall  написал (-а):

Piggy-backing on this, is there a way to export all layouts from an AutoCAD file to a single PDF? I have been able to create separate PDF's for each layout but I would like to create a single PDF which includes all of the layouts combined. 


Judging by the fact that you ask a question in different topics, you don’t know how to program and you need a ready-made solution.
Then use this - Revers 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 8 of 10

amy.mccall
Participant
Participant

Thanks for the clarification @Ed__Jobe. That is exactly what I am trying to do; use VBA to export all drawings to a single PDF. So it sounds like there is no way to do this using VBA's ACAD library commands. Thanks for your help.

0 Likes
Message 9 of 10

Norman_Yuan
Mentor
Mentor

You are right by saying "there is no way to do this using AutoCAD VBA" only. But if you can find and use third party COM component that can do PDF page merging work (paid, or freeware), then it would be a fairly easy task. However, at this stage of technology evolvement, using AutoCAD .NET API would be more natural choice, which has built-in publishing API that does what you want, and there are also tons of free/paid PDF manipulation libraries available. IMO, it is time to NOT WASTE time on VBA.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 10 of 10

Ed__Jobe
Mentor
Mentor

@amy.mccall wrote:

Thanks for the clarification @Ed__Jobe. That is exactly what I am trying to do; use VBA to export all drawings to a single PDF. So it sounds like there is no way to do this using VBA's ACAD library commands. Thanks for your help.


As @Norman_Yuan mentioned, .NET can do it, but VBA still can if that's all you have. For example, I use Bluebeam to publish to pdf. I would look into Bluebeam's api to post process the pdf's if I want to. Norman mentioned that there are other pdf processing apps that are free. You just need to use their api to combine pdf's after acad plots them.

 

Whether you choose .NET or VBA or lisp, the idea is that you have to get an api that handles combining of pdf's. Being newer technology, .NET is the most powerful api. I'm not sure of the specific api that Norman mentioned, but if you wish to do this with NET, then just post a question in that forum.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes