Cannot create PDF in landscape mode

If you are a VFP developer and have any questions about using our products from VFP here is the place to post them.
Post Reply
lewmik01
Posts: 3
Joined: Wed Jun 23 2010
Location: Scotland
Contact:

Cannot create PDF in landscape mode

Post by lewmik01 »

I am using PDF Converter 4.0 with the ActiveX interface, and Visual FoxPro 9 SP1.

I'm not sure if this is the best place to post this question. It is a programming question, but it is not specific to VFP.

I am simply trying to create a PDF file in landscape mode.

The document that I am trying to convert to PDF is itself landscape. It is generated by a third-party component within my VFP application. The document always prints in landscape when I print it to a physical printer, or when I convert it to PDF using a different driver (not the Amyuni driver). It is only when I use Amyuni that it fails.

Here is the relevant part of my code.

Code: Select all

WITH this.oAmy
	.EnablePrinter(this.cCustomer, this.cCode)
	.DefaultFileName = lcTargetFile
	.Orientation = 2			
	.FileNameOptionsEx = 3  	
ENDWITH 
Everything else works fine. But the PDF always comes out in portrait.

Thank you in advance for your help.

Mike
Mike Lewis
(Software developer)
lewmik01
Posts: 3
Joined: Wed Jun 23 2010
Location: Scotland
Contact:

Re: Cannot create PDF in landscape mode

Post by lewmik01 »

Did I post this question in the wrong section? Would I get a response if I post in the VB section? I posted it here because VFP is my development platform, and there doesn't seem to be a section for non-platform specific programming questions.
Mike Lewis
(Software developer)
Devteam
Posts: 119
Joined: Fri Oct 14 2005
Location: Montreal
Contact:

Re: Cannot create PDF in landscape mode

Post by Devteam »

VFP saves the printer configuration with the report. It seems that in your case, the configuration for PDF Converter is saved as Portrait. There are 2 fields in the VFP reports that be cleared to force VFP to Forget the configuration.

When printing to other printers, are you manually setting the orientation in the printer properties or letting VFP decide on the orientation? If you are manually forcing the orientation, then you can try adding the call to SetDefaultConfig to the list of calls to PDF Converter.
Amyuni Development Team

Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
lewmik01
Posts: 3
Joined: Wed Jun 23 2010
Location: Scotland
Contact:

Re: Cannot create PDF in landscape mode

Post by lewmik01 »

Hi DevTeam,

Thanks for your reply.

However, you say that "VFP saves the printer configuration with the report". I know about that, but in this case I am not outputting a VFP report. The output comes from a third-party grid control. I am calling that control's Print function. I have set the orientation to landscape within the control, and it correctly prints in landscape when printing to a physical printer or a non-Amyuni PDF driver. It is only with PDF Converter that it prints in portrait.

I have had no problem with using Amyuni for VFP reports. In those cases, it prints in either portrait or landscape as expected.

Mike
Mike Lewis
(Software developer)
Post Reply