Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I tell a Adobe Acrobat to print documents landscape

Status
Not open for further replies.

Triedit

Technical User
Mar 9, 2001
28
GB
I have a form in Paradox with tick boxes to print any number of PDF documents. The user checks the box next to the document(s) required and then presses one button which opens Adobe and sends all the documents to print...brilliant. However, some of the documents are in landscape format but are being printed in portrait.

This the code I'm using:

Uses"Shell32.dll"
ShellExecuteA( hWnd CLONG,lpOperation CPTR,
lpFile CPTR,lpParams CPTR,
lpDirectory CPTR, nShowCmd CWORD) CLONG
enduses

method pushButton(var eventInfo Event)
var
strDir,
strPDF String
liRetVal longInt
endvar
strDir= "G:\\XXX\\PDF\\"
strPDF = "RAI 0101.pdf"
if not isFile(strDir+strPDF)then
msgStop("Can't Open File", "Reason: Can't find a file named"+
strDir+strPDF + "\"; please check the name.")
else
ShellExecuteA(0,"print",strPDF,"",strDir,0)
endif

endMethod

Can anyone tell me where and what code to put in to make it print landscape?

Any answers gratefully received...as usual.

Thanks
Annie
 
Hmmm.

I think the PDF had to be created in Landscape.

If you open the PDF in question and print it, without making any changes, does it print in Landscape or Portrait?

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Tony

The original file was created in WordPerfect, in landscape, and then published to PDF. However, when I open the PDF in Acrobat Reader and send it to print I have to select the landscape option in the printer dialog otherwise it will print portrait.

Annie
 
That's what I was afraid of.

You don't have an option to set orientation when using shellexecuteA, unfortunately.

I've just be trying out Acrobat using OLE.

Unfortunately, whether reader or full, the OLE printing doesn't work (at least not in my testing; 4 Full and 7 Reader).

I'm afraid you may need to set up a printer that has Landscape set by default, or change your default printer to Landscape prior to printing.

There are some freeware apps that view pdf docs; haven't found activeX that would allow you to run/print things programmatically/easily.

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top