Print Page | Close Window

NewOutline - The Page No doesn't update properly

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=1230
Printed Date: 06 Jun 25 at 8:07PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: NewOutline - The Page No doesn't update properly
Posted By: thya
Subject: NewOutline - The Page No doesn't update properly
Date Posted: 02 Oct 09 at 2:04PM
Hi,
    I am Thya and  am evaluating the QuickPDF library for our internal company use.

I am testing the code with the "Copy bookmarks" from one pdf file to another PDF. I was success with the copy operation. However, the PageNo of the NewOutline() function seems to be working wrongly. It correctly update the concerned PDF file, however, if we open the PDF file in the Adobe reader, the outline points to the one page before actual page.

For example, If the source outline pointing to the 7 page, The bookmark created with the Quick pdf library is pointing to the page no 6.

If i open the PDF in the Adobe Acrobat 9, the page no. in the outline still displays correct page number, however if clicked, it navigates to the page the targetted page (page no - 1).

Please help me in this regard. As I will have to provide the beta version of the software today, Any immediate help would be appreciated.

Code and/or sample generated pdfs can be uploaded on request.



Replies:
Posted By: Ingo
Date Posted: 02 Oct 09 at 2:28PM
Hi Thya!

Welcome here!
This is a user-user-forum. So it's not guaranteed that you'll get an answer very quickly. If there're no users with your prob and experiences to solve it then you'll never get an answer here.
If you need "immediate help" then you should post/call on the official product pages:
http://www.quickpdflibrary.com/support/index.php

Cheers, Ingo



Posted By: thya
Date Posted: 03 Oct 09 at 4:50AM
Hi Ingo,
      I have poseted the same problem in the Support page also.
If i get any response here asap, i will be able to complete the project today.

Thanks for your quick response.
Thya


Posted By: thya
Date Posted: 03 Oct 09 at 4:58AM
Please download the PDF and see the bookmarks. it is pointing to the wrong page no. However, if you open the file in the Adobe acrobat,  Bookmarks's page no are showing correct page no.
if we just do a update and save changes, it will work properly.

http://codeguyz.co.cc/thiyagu/The%20Art%20of%20Solving%20Problems-copy.pdf - http://codeguyz.co.cc/thiyagu/The%20Art%20of%20Solving%20Problems-copy.pdf


Posted By: Ingo
Date Posted: 05 Oct 09 at 6:24AM
Hi!
Not only with Acrobat... Foxit shows the correct pages, too.
Very strange...?



Posted By: thya
Date Posted: 05 Oct 09 at 6:38AM
Yes, You are right!

Please download the source from the location:
 view-source:http://www.esnips.com/r/hmfl/doc/9a1a3762-1e11-48bb-a728-0435e95c5ecc/CopyBookmarks - http://www.esnips.com/r/hmfl/doc/9a1a3762-1e11-48bb-a728-0435e95c5ecc/CopyBookmarks 

Please let me know if you find any strange thing in the code.



Posted By: thya
Date Posted: 06 Oct 09 at 3:45AM
Hi Ingo,
      Thanks for all.
I got a solution from Support Team. I have given here the full text of the support mail
-------------------------------------------------
Thya,

Thanks for your patience.

I've reviewed the code that you sent through and noticed the issue that could be causing the problem.

For the AddBookmarks function that you've created, you're specifying 0,0 for the destination position of the bookmark (i.e. the position on the page that the user is shown when they click on a bookmark). With the default page origin (bottom left corner of the page) this will mean that the user is shown the very bottom of the page at the top of the screen, which might be the next page. By calling the SetOrigin(1) function you can change the default page origin to be the top left corner. This would mean that the user would be shown the top of the page when they click on the bookmark.

---
static void AddBookmarks(QuickPDFAX0716.PDFLibrary QP, Node<OutLine> root, int NewParentID)
{
OutLine Parent = root.Data;

foreach (Node<OutLine> i in root.Children)
{
OutLine t = i.Data;


QP.SetOrigin(1) // This sets the page origin to the top left corner

int temp = QP.NewOutline(NewParentID, t.OutlineTitle,t.PageNo, 0D);

if (i.Children.Count > 0)
{
AddBookmarks(QP, i, temp);
QP.CloseOutline(temp);
}
}
}
---

I've updated your code above, to call SetOrigin(1), can you let me know how this goes on your end?

Cheers,
Rowan
-----------------------------------------------------------

- Rowan.



Posted By: thya
Date Posted: 08 Oct 09 at 7:03AM
xfgh dfg



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