Orientation switching on the fly

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
MikeB
Posts: 5
Joined: Mon Jul 31 2006

Orientation switching on the fly

Post by MikeB »

Hi,

I'm using VB and Amyuni version 2.5

I'm generating a series of documents and I want some of them in portrait and some in landscape. I'm finding that ALL of the documents I generate are the same orientation as the first one, in other words I can make them ALL portrait or landscape. If I use the cdi.Orientation to change the orientation after a document has been generated the new setting is not honored.

Can you tell me how to change orientation on the fly. I have considered destroying and recreating the printer object itself but the performance rammifications are a problem

Thanks for your help.
Michael
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You need to call SetDefaultConfig() after you call to SetOrientation for the new settings to take place.
MikeB
Posts: 5
Joined: Mon Jul 31 2006

Post by MikeB »

Hi,

Thanks for your response. I found and tried that. Here is the code I'm using to switch orientation:

Public Sub SetLandscape(blnLandscape As Boolean)
' Set landscape according to the param boolean.
If blnLandscape Then
m_cdi.Orientation = 2
m_cdi.SetDefaultConfig
Else
m_cdi.Orientation = 1
m_cdi.SetDefaultConfig
End If
End Sub


m_cdi is a pointer to the cdi object. I have also tried setDefaultConfigEx, but that didn't work either.
MikeB
Posts: 5
Joined: Mon Jul 31 2006

Any further help?

Post by MikeB »

Do you have any further thoughts? I still can't switch orientation once a pdfprinter has been initialized.

When I tried reinstalling the printer object between print jobs I found that the uninstall was deleting the generated PDF files, but not the references to them.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

I checked this issue, this is due most probably due to the printing application, you get the default devmode once and you print the documents.
Whenever you change the default config, you need to reopen the printing application and continue printing.

Hope this helps.
MikeB
Posts: 5
Joined: Mon Jul 31 2006

printing app

Post by MikeB »

Our printing application is MS internet explorer. I'll look into updating it so that it knows that we've switched to landscape.

Thanks for the suggestion.
Post Reply