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!
![]() |
SetPageContent |
Post Reply
|
| Author | |
thangnvhl
Beginner
Joined: 20 Apr 10 Status: Offline Points: 18 |
Post Options
Thanks(0)
Quote Reply
Topic: SetPageContentPosted: 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? |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
thangnvhl
Beginner
Joined: 20 Apr 10 Status: Offline Points: 18 |
Post Options
Thanks(0)
Quote Reply
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"; |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store