Landscape printing

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
Mikko
Posts: 5
Joined: Thu Oct 20 2005

Landscape printing

Post by Mikko »

Hello,

How do I set programmatically landscape printing. I open existing pdf and try to access page-objects "Landscape" attribute but I can not find ObjectAttribute method. If ObjectAttribute is not member of iacDocument.

I also tried to get PageFormat and set it's Landscape property to true but it didn't help either. I am using PDF Creator .NET 2.0 g-3.

'...
Dim fmt As Amyuni.PDFCreator.IacPageFormat
doc = New Amyuni.PDFCreator.IacDocument(Me)

If doc.Open(fs, "") Then
fmt = doc.GetPageFormat()
fmt.Landscape = True
doc.Print("", False)

'...

Thanks in advance.
Mikko
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Are you using PDF Creator or PDF Creator.Net? I guess version 2.0g-3 is for the Creator the .Net version is g and not g-3.

If you wish to set a page to landscape you can use the following call:

.ObjectAttribute("Pages[1]", "Landscape") = True

Hope this helps.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Are you using PDF Creator or PDF Creator.Net? I guess version 2.0g-3 is for the Creator the .Net version is g and not g-3.

If you wish to set a page to landscape you can use the following call:

Code: Select all

.ObjectAttribute("Pages[1]", "Landscape") = True
or you can using the below C#code:

Code: Select all

using ( IacDocument document = new IacDocument( null ) )
					{
						Amyuni.PDFCreator.IacPage Page1 = document.GetPage(1);
				
						document.Open (testfile,"");
						Page1.AttributeByName("Rotate").Value = 90;
						using(System.IO.FileStream newfile = new System.IO.FileStream("Landscape.pdf", FileMode.Create, FileAccess.Write, FileShare.Read))
						{
							document.Save(newfile,0);
						}

Hope this helps.
Mikko
Posts: 5
Joined: Thu Oct 20 2005

Post by Mikko »

Hi, thanks for reply. I found from the manual that you can set the landscape on by using .ObjectAttribute(... but the problem is which objects method it is?

I am using following code (vb.net):

'....

Dim doc As Amyuni.PDFCreator.IacDocument
Dim fs As System.IO.FileStream

doc = New Amyuni.PDFCreator.IacDocument(Me)

fs = New System.IO.FileStream("c:\amyuni\sample.pdf", System.IO.FileMode.Open)

If doc.Open(fs, "") Then
doc.ObjectAttribute("Pages[1]", "Landscape") = True
doc.Print("", False)
End If

fs.Close()

'....

This does not work because compiler says 'ObjectAttribute' is not a member of 'Amyuni.PDFCreator.IacDocument'. I am using PDF Creator .NET 2.0g.

Thanks in advance
Mikko
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

For the error message please get back to support@amyuni.com

The sample that turn the page page 90 degrees works under .Net I try it.
Post Reply