Print Page | Close Window

SetPageContent

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=1423
Printed Date: 28 Jan 26 at 4:44AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SetPageContent
Posted By: thangnvhl
Subject: SetPageContent
Date Posted: 22 Apr 10 at 5:11AM
I have following code to add a new page to an existing file.

PDFLibrary PDFLib = new PDFLibrary();

if (PDFLib.UnlockKey("MyRegisteredKey") == 1)
{
     if (PDFLib.LoadFromFile(sInputPdfFile) == 1)
     {
          if (PDFLib.SelectPage(PDFLib.PageCount()) == 1)
          {
               int iNewPage = PDFLib.NewPage();

               if (iNewPage != 0)
               {
                    if (PDFLib.SelectPage(iNewPage) == 1)
                    {
                         PDFLib.CombineLayers();
                         PDFLib.SetPageContent(sContent);
                         PDFLib.SaveToFile(sOutputFile);
                    }                    
               }             
          }
     }
}

After execute application, I open the result file and scroll to the last page (mean new page). I received error: "An unrecognized token 'Electronically' was found". Then, content of new page is blank.

Did I make something wrong in my code?



Replies:
Posted By: Ingo
Date Posted: 22 Apr 10 at 8:12AM
Hi!

If you want to have existing content of a page to a new page of the same document you should use the clone- or copy-functions for pages:
http://www.quickpdflibrary.com/help/quickpdf/PageManipulation.php
In your code i don't see a GetPageContent... only a set... so in sContent is nothing?
But again: Use copy... or clone...

Cheers and welcome here,
Ingo



Posted By: thangnvhl
Date Posted: 22 Apr 10 at 8:25AM
Dear Ingo,

Thanks for your reply. I'm not going to clone or copy content of an existing page to a new page. I only want to write new content that was saved to sContent variable to my new page

In my code, sContent is a string variable that was assigned before.
ex: sContent = "This is my content to write to new page";


Posted By: Ingo
Date Posted: 22 Apr 10 at 11:50AM
Hi!

If you want to see the string
"This is my content to write to new page"
on your new page you should use DrawText.
http://www.quickpdflibrary.com/help/quickpdf/Text.php

Cheers, Ingo




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