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!
Problem with adding text to a existing PDF |
Post Reply |
Author | |
sharath77
Beginner Joined: 07 Apr 09 Location: India Status: Offline Points: 2 |
Post Options
Thanks(0)
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
sharath77
Beginner Joined: 07 Apr 09 Location: India Status: Offline Points: 2 |
Post Options
Thanks(0)
|
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.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
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