PDF Creator and printer configuration

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
mauribon
Posts: 11
Joined: Mon Oct 18 2004

PDF Creator and printer configuration

Post by mauribon »

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
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

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?
mauribon
Posts: 11
Joined: Mon Oct 18 2004

Post by mauribon »

Sorry, but this tells the printer to fit the drawing to the current paper dimension, and not to set is dimension. Right ?
Thanks.
Maurizio
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You can change the page size and orientation in the Creator and then print it, will this help?
mauribon
Posts: 11
Joined: Mon Oct 18 2004

Post by mauribon »

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
Post Reply