Print Page | Close Window

Horizontal Thumbnails Look like 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=2449
Printed Date: 29 Sep 24 at 1:11AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Horizontal Thumbnails Look like Portrait
Posted By: CrazyTIm
Subject: Horizontal Thumbnails Look like Portrait
Date Posted: 08 Nov 12 at 7:47AM
Hi all,

I have a PDF which I am resizing all the pages to A4 while preserving the orientation. After I do this I have noticed the thumbnails are all Portrait, but only on the iPad. In Acrobat on my PC they show as normal.

I have tried re-rendering the thumbnails using the code below (VB.NET), but strangely this doesn't work, which makes me think it is a property of the page I have missed when resizing it, not the thumbnail itself:
' update page thumbnails
For i = 1 To Q.PageCount
    Dim ImageContent = Q.RenderPageToVariant(96, i, 0)
    Dim ImageID As Integer = Q.AddImageFromVariant(ImageContent, 1)
    Q.SelectImage(ImageID)
    Q.SelectPage(i)
    Q.SetPageThumbnail()
Next

Does something stand out that would fix this, such as adjusting dimensions of the Media Box, Crop Box, Bleed Box, Trim Box or Art Box? I'm not sure what the difference between these are.

Thanks, Jason.



Replies:
Posted By: CrazyTIm
Date Posted: 08 Nov 12 at 7:51AM
This is a stack overflow question similar to the problem I am facing, however it is with a different library:

http://stackoverflow.com/questions/11736590/creating-a-thumbnail-from-pdf-using-c-sharp-orientation-is-important


Posted By: CrazyTIm
Date Posted: 09 Nov 12 at 1:36AM
I think I have figured it out. The issue I am having seems to be a problem with how the iPad renders page thumbnails, that is why they look OK on my PC in Acrobat but not on the iPad.

I have tested for an hour or so, and it seems the native PDF viewer in the iPad renders thumbnails differently than Acrobat *for pages that have been rotated*. More specifically, if a portrait page has been rotated to landscape, the thumbnail on the iPad stays in portrait, but the image on the thumbnail gets white bars at the top and bottom.

SO it looks like the iPad uses the dimensions of the PDF page to draw the shape of the thumbnail, and then draws the rotated page inside of that, which is a bit confusing to say the least!


Posted By: CrazyTIm
Date Posted: 09 Nov 12 at 1:45AM
I have a follow-up question to my problem: To get around this I need to reset the rotation of all pages to 0, and for every page that *was* rotated I need to rebuild a new page in Horizontal layout and draw the content rotated in place. Is this possible using the QuickPDF library? the RenderPageToVariant function seems to render it local to the original coordinates and there is no way to rotate the content. Is this correct?

This all seems to be a very specific problem with the iPad so I'm not too concerned if this can't be done. I'll just have to wait for an IOS update that fixes it :).

Thanks, Jason


Posted By: CrazyTIm
Date Posted: 09 Nov 12 at 1:47AM
You know what? A function SetRenderRotation would be what I'm looking for! ...


Posted By: Ingo
Date Posted: 09 Nov 12 at 7:00AM
Hi Jason!

If you need a new functionality you shouldn't ask here
in the user-user-forum. Take the official support-pages.
There is a place to post new wanted requirements:
http://www.quickpdflibrary.com/support/support-query.php

Cheers, Ingo


Posted By: AndrewC
Date Posted: 09 Nov 12 at 10:58AM
Jason,

The QP.NormalizePage(0) will reset the page rotation to 0 degrees.

  QP.LoadFromFile ("rotated.pdf", "");
  for i = 1 to QP.PageCount() do
  begin
    QP.SelectPage(i);
    QP.NormalizePage(0);
  end;
  QP.SaveToFile("0degrees.pdf");

Andrew.


Posted By: CrazyTIm
Date Posted: 11 Nov 12 at 11:06PM
Serious! This solved my problem :D,  thanks 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