Printing in landscape

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
gurleen
Posts: 6
Joined: Wed Nov 03 2004

Printing in landscape

Post by gurleen » Wed Nov 03 2004

Hi,
I have a PDF file that I want to print in landscape , but when I use print it gets printed in potrait. This is my code. What do I need to do so that the PDF gets printed in the format that it was saved in.

Dim PDF1 As New ACPDFCREACTIVEX.PDFCreactiveX
On Error Resume Next
With PDF1

.SetLicenseKey "Applianz Technologies, Inc.", "XYZAS"
.Open path, ""

' for print,the first argument is the printer name ( if none is provided it uses the default printer )
' the second argument is a boolean , if set to true it opens up the print dialog box
.ScaleToPrinter = acScaleBoth
If sendToDefault = True Then
.Print "", False
Else
.Print "", True
End If

End With

Set PDF1 = Nothing

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Thu Nov 04 2004

Hi,

Where are you setting the PDF document to be printed in Lansdcape?

Is the PDF a landscape document or is the printer set to print in Landscape mode?

You can set the paper orientation to landscape by using the 'Landscape' property of the page object in the PDF Creator (Ref: "PDF Creator Developer Manual.pdf" page 22).

Hope this helps.

gurleen
Posts: 6
Joined: Wed Nov 03 2004

Post by gurleen » Thu Nov 04 2004

The PDF fil eis created by printing a file to amyuni Printer. Well the problem is that I dont know what orientation the PDF is coming in. It can be Landscape or Portrait . I just want to print the file the way it was generated .

Eg: I create a file using notepad and print to amyuni printer with orientation set to Landscape. When I use my code to open the PDF created in the above step and print , it prints to Portrait rather than landscape.

It looks like Orientation is set to the default of the printer rathen than what I used to create the PDF file using Amyuni Printer.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Fri Nov 05 2004

Hello,

Which versions of the PDF Converter and PDF Creator are you using?

In general if you generate a pdf file using the PDF Converter and set some settings in it like Landscape than print this file using the PDF Creator, all the settings are kept in the file and the printing is done accordingly, unless you your printer does not print according to the printing application but to its own settings.

When generating the PDF file, are you saving it in View only mode or in View and Design mode? Try to save it in View and Design or Design only mode.

gurleen
Posts: 6
Joined: Wed Nov 03 2004

Post by gurleen » Fri Nov 05 2004

The PDF file is created by sending the print job to amyuni Printer which is set as the default printer. So I dont have to do anything to get the pdf file generated. Once I have this PDF I then try to print it using amyuni ActiveX Object (ACPDFCREACTIVEX.PDFCreactiveX) and get into the problem of Orientation.

This morning I tried to print using CDIntfEx.Document and it works fine . Landscape prints as landscape and Portrait prints as portrait. Now I have a new problem . I want the user to have the option to choose the printer.
I could easily do that with ACPDFCREACTIVEX.PDFCreactiveX as it had an option in the print method where I could choose the dafault printer or
get the print dialog box opened . Is there a way to do the same using CDIntfEx.Document .


printerDeviceName = Printer.DeviceName
Dim DOC As New CDIntfEx.Document
With DOC
.SetLicenseKey "Applianz Technologies, Inc.", "XYDDFSGSFG..."
.OpenEx path, ""
.Print printerDeviceName, 1, DOC.PageCount, 1
End With
Set DOC = Nothing


Looks like both object have some shortcomings

1. ACPDFCREACTIVEX.PDFCreactiveX : Does not print landscape
2. CDIntfEx.Document : Could not find the option in the print method for opening the print dialog box.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Tue Nov 16 2004

Hello,

The .Print function of the Document object doesn't allow you to open the Print dialog box, but it allows you to spcify the printer to which you want to print your pdf document. You are already specifying the printer name in your code.

Also the PDF Creator enables you to print documents in Landscape.

Are you still facing problems?

Post Reply