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 - Problem with adding text to a existing PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem with adding text to a existing PDF

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

Joined: 07 Apr 09
Location: India
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote sharath77 Quote  Post ReplyReply Direct Link To This Post Topic: Problem with adding text to a existing PDF
    Posted: 07 Apr 09 at 1:36PM
Hello,
 
I am trying to add some text to a existing PDF using a C# (.NET 1.1 framework)  application. Below is my code snippet. But the generated PDF does not contain the text written, but contains the contents of the source PDF as well as a blank new page.
 
string strSource = @"D:\Test\1231_001.pdf";   
string strDest = @"D:\Test\outputsample.pdf";
pdf = new QuickPDFClass();   
if (pdf.Unlocked() == 0)
{
 nResult = pdf.UnlockKey("My key");
}
DA_HANDLE = -1;//op_add
DA_HANDLE = pdf.DAOpenFile(strSource, "");
if (DA_HANDLE <= 0)
{
 MessageBox.Show("Error occured while opening");
 return;
}

nResult =pdf.DANewPage(DA_HANDLE);
nResult =pdf.SelectPage(pdf.PageCount());
pdf.SetTextColor(1,0,0);
pdf.DrawText(10,10,"Email Subject");
nResult= pdf.DASaveAsFile(DA_HANDLE,strDest);
if (nResult==1)
{
 MessageBox.Show("Saved");
}
pdf.DACloseFile(DA_HANDLE);
DA_HANDLE = 0;
 
Any help with this regard is greatly appreciated.
 
Thanks in advance.


Edited by sharath77 - 07 Apr 09 at 1:45PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Apr 09 at 5:45PM
Hi!

You're mixing DA-functions and "not-DA-functions".
If you're opening the file with DAOpenFile then you should select your page with DAFindPage. My advice for you is: Don't use the DA-functions first. Earlier versions of QuickPDF had sometimes few memory problems. With the DA-functions these behaviors should be avoided but with the current version this shouldn't be necessary anymore. So please no mixing!

Cheers, Ingo
Back to Top
sharath77 View Drop Down
Beginner
Beginner
Avatar

Joined: 07 Apr 09
Location: India
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote sharath77 Quote  Post ReplyReply Direct Link To This Post Posted: 27 Apr 09 at 11:11AM
Thanks for the reply, but the version we are using is 4.42.1.1, is this version safe enough to use with non DA functions, or would there be memory problems.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 27 Apr 09 at 11:35AM
Hi!

You'll have a lot of probs in the future! More and more...
All new pdf-specs aren't supported in your very old version.
You should update as quick as possible.
In your version there are a lot of memory probs.

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