VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rotate Pages of PDF using AUTOCAD vba

10 REPLIES 10
Reply
Message 1 of 11
divyasree
1119 Views, 10 Replies

Rotate Pages of PDF using AUTOCAD vba

hi
Can anyone help me how to rotate pages of PDF using vba programming.Which dll controls PDF documents.

Please anyone help me...
Thanks in advance
Divya
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: divyasree

If these are existing PDF's you won't be able to do it without having some sort of a pdf writer like Adobe. If you're printing pdfs in your code and they come out rotated, then you need to get the orientation right before making them.

Viktor.
Message 3 of 11
divyasree
in reply to: divyasree

Hi

Actually i have done a code which creates of given layouts list.this creates each layout in individual PDF.I have inserted all layouts to one.even though my layouts are in landscape orientation it creates PDFs in Portrait orientation.So i would like to know how to rotate pages by the same time when i create it.
Thanks in advance
Message 4 of 11
Anonymous
in reply to: divyasree

Are you doing something like this in your code:

ThisDrawing.ActiveLayout.PlotRotation = ac0degrees
Message 5 of 11
divyasree
in reply to: divyasree

No.i m not doing anything like this.i want pdf page rotation.could u plz help me..

Thanks in advance
Message 6 of 11
hanchris
in reply to: divyasree

I am looking for this same answer and wondering if there is any new takers.

How do you pick either "Landscaping" or "Portrait" in VBA?

Thanks.
Message 7 of 11
arcticad
in reply to: divyasree

In the Pc3 file for the Adobe Printer. You need to Set the custom size for each sheet.

You will need to go into the custom settings and click on the advanced button at the bottom.

I do this by setting PostScript Custom Paper Sizes to the Opposite.

Say the Drawing is 11x17. Change the Setting to 17X11 and then set the Orientation to Landscape.

Make Sure that in Filter paper Sizes only PostScript Custom Page Size is checked.

Then your drawing will come out rotated correctly.
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 8 of 11
hanchris
in reply to: divyasree

We use a network Post Script printer (there is a whole other issue with the .pc3 file that I mention in the Printing forum). We still have a custom setting; but does this mean we have to do it, for every computer that uses this macro?

I guess we have no choice; but in a way it sort of seems like there has to be a way in code to do it since you can change pretty much every other print setting, through VBA.

Just thinking out loud here, if we set up a Page Seup can we then call it and just re-update the Window coordinate, in VAB, and the rest of the settings will remain the same? (If I do not here back, then I may end up replying to my own post once I have the answer.)
Message 9 of 11
hanchris
in reply to: divyasree

Well, as I am sure it is quite obvious to everyone here; but yes you can call a page setup and then change every other style. I created a page setup called "Portrait" and then set another page setup as the current. I then ran the following code and my drawing came out perfectly.

{code}

Dim psPortrait As AcadPlotConfiguration
Set psPortrait = ThisDrawing.PlotConfigurations.Add("Portrait")
ThisDrawing.ActiveLayout.CopyFrom psPortrait

{code}

I guess I can now create a file with these in it and call it to import page setups, which I am good at...well in LISP. :o)

Thanks for getting the juices moving.
Message 10 of 11
arcticad
in reply to: divyasree

I've had issues with the drawing where it prints landscape but shows the drawing on it's side.

Setting the view seems to only affect it's local orientation and not the final PDF file orientation.

Setting the pc3 file seems to be the only reliable situation.

I had to set pc3 files on every machine

Adobe 11x17
Adobe 24x36
Adobe 36x48 .....

Then have my code use those pc3 files in the configuration.

as this is my own experience, I know other haven't had this issue.
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 11 of 11
ChristinaSeay
in reply to: divyasree

I am having this same problem... but I can't figure out how to create a pc3 file for PDFCreator so I can change the paper dimensions. Can someone please explain how you would do this?? Edited by: ChristinaSeay on May 8, 2009 1:28 PM

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

Post to forums  

Autodesk Design & Make Report

”Boost