Print Page | Close Window

Problem when printing A3 landscape as A4 portrait

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1860
Printed Date: 22 Nov 24 at 7:32PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problem when printing A3 landscape as A4 portrait
Posted By: Andi
Subject: Problem when printing A3 landscape as A4 portrait
Date Posted: 16 Jun 11 at 9:40AM
Hi,

I'm trying to print the following PDF, which contains an A3 landscape page

http://home.in.tum.de/%7Ewengera/Din_A3_Datenblatt.pdf - http://home.in.tum.de/~wengera/Din_A3_Datenblatt.pdf

in A4 portrait mode. That means, I want it to have 50% scaled and rotated by 90°.

I do:

String customPrinter = qp.NewCustomPrinter(printerName);
qp.SetupCustomPrinter(customPrinter, 1, 9); //1: paper size. 9: DMPAPER_A4
int o = qp.PrintOptions(1, 1, "bla"); //auto-scale, auto-rotate
qp.PrintDocument(customPrinter, 1, qp.PageCount(), o);

It is rotated and scaled correctly, but shifted to the right! See the result:

http://home.in.tum.de/%7Ewengera/Problem.pdf - http://home.in.tum.de/~wengera/Problem.pdf

Is this a bug? Did I miss anything?

Thanks :-)


Andi



Replies:
Posted By: Andi
Date Posted: 17 Jun 11 at 2:46PM
I have found a rather simple solution, that works at least for my example PDF.

//rotate all rotated pages back to 0 degrees
for (int page = 1; page <= qp.PageCount(); page++)
{
  qp.SelectPage(page);
  if (qp.PageRotation() != 0)
    qp.RotatePage(0);
}

Then, when printing with auto-scaling, but no auto-rotation, everything works fine :-)

Nevertheless I hope that the bug gets fixed in the next release.


Posted By: CrazyTIm
Date Posted: 22 Aug 11 at 5:25AM
Brilliant! Solved my problem. 

For me certain large PDFs didn't scale properly according to the PrintOptions. But now it works OK as I just rotate pages before printing.

Cheers, Jason.


Posted By: AndrewC
Date Posted: 24 Aug 11 at 2:30AM
We will try and fix this for the 8.11 release.  Pages with no rotation work well but we run into problems when the page rotation flag is set to 90, 180 or 270.

The solution to rotate the page to 0 degrees and then back again is the best solution and is quickest and the easiest for the time being.

Andrew.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk