page rotation

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
jon
Posts: 12
Joined: Mon Aug 18 2003

page rotation

Post by jon »

Hello,

I would like to rotate one or more page in a pdf file by programmation.

It seem's that it isn't possible to do this with creator.

The only way I fund it's to print the page and reinsert it into the file...

Have you a better solution?

Thxs
jon
Posts: 12
Joined: Mon Aug 18 2003

Re: page rotation

Post by jon »

jon wrote:The only way I fund it's to print the page and reinsert it into the file...
I would say, a solution is to rotate page with converter's dll and save the file...

A solution with creator?
jon
Posts: 12
Joined: Mon Aug 18 2003

Post by jon »

Another problem... when i do this:

Code: Select all

pdf.open("cdintfex.document")
pdf^open(Filename.pdf)
pdf^rotate(90)
pdf^save(filename.pdf)
The document rotates... but when I do a new time the manipulation, The document stay the same...

I would like to do a complete rotation (180°)
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

The PDF Converter has the ability to rotate pages of existing PDF documents. I have included a snippet of visual basic code to illustrate this.
You have mentioned that the rotate page option is not possible with the PDF Creator, this is not the case. I have also attached a snippet of that code also. Hope this helps.

PDF Converter Code
Private Sub cmdRotate_Click()
On Error GoTo invalid_file
'create an object of type Document
Dim doc1 As New CDIntfEx.Document

' open two existing documents
doc1.Open "C:\temp\FivePageB.pdf"
doc1.Rotate = 90
doc1.Save "C:\temp\FivePageB_rotate_cdintf.pdf"
Exit Sub

invalid_file:
Set doc1 = Nothing
End Sub

PDF Creator Code
Private Sub cmdRotatePage_Click()
Dim Width As Integer
Dim PDF2 As Object
Set PDF2 = CreateObject("PDFCreactiveX.PDFCreactiveX")

With PDF2
.SetLicenseKey LicenseTo, ActivationCode

'Open file to rotate
.Open "c:\temp\sample.pdf", ""
.CurrentPage = 1

'Change report state
.ReportState = acReportStateDesign

'Rotate and change page settings

.ObjectAttribute("Pages[1]", "Rotate") = 90
Width = .ObjectAttribute("Pages[1]", "Width")
.ObjectAttribute("Pages[1]", "Width") = .ObjectAttribute("Pages[1]", "Length")
.ObjectAttribute("Pages[1]", "Length") = Width


'Change report state
.ReportState = acReportStateRun
'save only document view
'Need to save in ViewMode and then reload the page
.Save "c:\temp\sample_rotate.pdf", acFileSaveView

Set PDF2 = Nothing
End With
End Sub
jon
Posts: 12
Joined: Mon Aug 18 2003

Post by jon »

Thxs ;)
jon
Posts: 12
Joined: Mon Aug 18 2003

Post by jon »

Jose,

I tried your code and it works well for a 90 degree rotation at the first go, but when I execute it a second time, the plain text object contained within the page seems to rotate out of view while the page remains at its initial angle/position.

Could you please explain?
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hi Jon,

We have resolved this situation and we will be releasing an updated version of to the PDF Creator late next.

Thanks
Post Reply