Rotate Pages of PDF using AUTOCAD vba

Rotate Pages of PDF using AUTOCAD vba

Anonymous
Not applicable
1,807 Views
10 Replies
Message 1 of 11

Rotate Pages of PDF using AUTOCAD vba

Anonymous
Not applicable
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
0 Likes
1,808 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
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.
0 Likes
Message 3 of 11

Anonymous
Not applicable
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
0 Likes
Message 4 of 11

Anonymous
Not applicable
Are you doing something like this in your code:

ThisDrawing.ActiveLayout.PlotRotation = ac0degrees
0 Likes
Message 5 of 11

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

Thanks in advance
0 Likes
Message 6 of 11

hanchris
Advocate
Advocate
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.
0 Likes
Message 7 of 11

arcticad
Advisor
Advisor
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))
0 Likes
Message 8 of 11

hanchris
Advocate
Advocate
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.)
0 Likes
Message 9 of 11

hanchris
Advocate
Advocate
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. 🐵

Thanks for getting the juices moving.
0 Likes
Message 10 of 11

arcticad
Advisor
Advisor
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))
0 Likes
Message 11 of 11

Anonymous
Not applicable
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
0 Likes