Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - SetPageContent
  FAQ FAQ  Forum Search   Register Register  Login Login

SetPageContent

 Post Reply Post Reply
Author
Message
thangnvhl View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Apr 10
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote thangnvhl Quote  Post ReplyReply Direct Link To This Post Topic: SetPageContent
    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?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
thangnvhl View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Apr 10
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote thangnvhl Quote  Post ReplyReply Direct Link To This Post 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";
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store