I am using the ActiveX version of PDF Creator 2.01d with Visual Basic 6 sp6.
I have to print a pdf document having the following paper dimensions: 840x594 (ISO A1); it was generated by Amyuni PDF Converter.
The destination is a HP Laserjet 8000 DN printer, and I would like to print it in A3 landscape format.
Can I set the printer page dimension ad orientation with PDF Creator?
Thank you in advance.
Maurizio
PDF Creator and printer configuration
Hello Maurizio,
Have you looked at the ScaleToPrinter option of the PDF Creator?
With PDF1
'Typically done once on a form_load
.SetLicenseKey LicenseTo, ActivationCode
.Open "c:\temp\fivepage.pdf", ""
'Print(PrinterName As String, Prompt As Long)
'If Prompt is set to True,
'the user is prompted with the printer selection dialog box.
'Prints to the default printer
' Scaling Options
'.ScaleToPrinter = acScaleBoth
'.ScaleToPrinter = acScaleHorizontal
'.ScaleToPrinter = acScaleNone
'.ScaleToPrinter = acScaleVertical
.ScaleToPrinter = acScaleVertical
.Print "", True
End With
Hope this helps?
Have you looked at the ScaleToPrinter option of the PDF Creator?
With PDF1
'Typically done once on a form_load
.SetLicenseKey LicenseTo, ActivationCode
.Open "c:\temp\fivepage.pdf", ""
'Print(PrinterName As String, Prompt As Long)
'If Prompt is set to True,
'the user is prompted with the printer selection dialog box.
'Prints to the default printer
' Scaling Options
'.ScaleToPrinter = acScaleBoth
'.ScaleToPrinter = acScaleHorizontal
'.ScaleToPrinter = acScaleNone
'.ScaleToPrinter = acScaleVertical
.ScaleToPrinter = acScaleVertical
.Print "", True
End With
Hope this helps?
I have written the following VB6 piece of code.
The .PDF file I want to print has 15 pages, all in A3 landscape format.
Which are the right commands to print that document in A3 or in A4, giving me the opportunity to choose the size before printing it ?
If, in the following code, I try to replace p.PaperSize = vbPRPSA4 to vbPRPSA3, it continue to print in A4. Why?
Thank you.
Private Sub Form_Load()
Dim PDF1 As New ACPDFCREACTIVEX.PDFCreactiveX
Dim p As Printer
Dim i As Integer
For Each p In Printers
If p.DeviceName = "StampaDisegni" Then
Set Printer = p
Exit For
End If
Next
Set p = Printer
p.Orientation = vbPRORLandscape
p.PaperSize = vbPRPSA4
With PDF1
.SetLicenseKey AMY_USER, AMY_SERIAL
.Open "T:\pse\Dis\30k\30038e\30038e68\30038E6800_it.pdf", ""
For i = 3 To 3 '.PageCount
.StartPrint p.DeviceName, False
'Imposta la pagina in formato A3 landscape
.ObjectAttribute("Pages[" & Trim$(i) & "]", "PaperSize") = vbPRPSA3
.ObjectAttribute("Pages[" & Trim$(i) & "]", "Landscape") = True
.ObjectAttribute("Document", "TraySelection") = 1
.ObjectAttribute("Document", "ScaleToPrinter") = acScaleBoth
.PrintPage i
.EndPrint
Next
End With
Set PDF1 = Nothing
End Sub
The .PDF file I want to print has 15 pages, all in A3 landscape format.
Which are the right commands to print that document in A3 or in A4, giving me the opportunity to choose the size before printing it ?
If, in the following code, I try to replace p.PaperSize = vbPRPSA4 to vbPRPSA3, it continue to print in A4. Why?
Thank you.
Private Sub Form_Load()
Dim PDF1 As New ACPDFCREACTIVEX.PDFCreactiveX
Dim p As Printer
Dim i As Integer
For Each p In Printers
If p.DeviceName = "StampaDisegni" Then
Set Printer = p
Exit For
End If
Next
Set p = Printer
p.Orientation = vbPRORLandscape
p.PaperSize = vbPRPSA4
With PDF1
.SetLicenseKey AMY_USER, AMY_SERIAL
.Open "T:\pse\Dis\30k\30038e\30038e68\30038E6800_it.pdf", ""
For i = 3 To 3 '.PageCount
.StartPrint p.DeviceName, False
'Imposta la pagina in formato A3 landscape
.ObjectAttribute("Pages[" & Trim$(i) & "]", "PaperSize") = vbPRPSA3
.ObjectAttribute("Pages[" & Trim$(i) & "]", "Landscape") = True
.ObjectAttribute("Document", "TraySelection") = 1
.ObjectAttribute("Document", "ScaleToPrinter") = acScaleBoth
.PrintPage i
.EndPrint
Next
End With
Set PDF1 = Nothing
End Sub