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
page rotation
Re: page rotation
I would say, a solution is to rotate page with converter's dll and save the file...jon wrote:The only way I fund it's to print the page and reinsert it into the file...
A solution with creator?
Another problem... when i do this:
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°)
Code: Select all
pdf.open("cdintfex.document")
pdf^open(Filename.pdf)
pdf^rotate(90)
pdf^save(filename.pdf)
I would like to do a complete rotation (180°)
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
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