Print Page | Close Window

MergeFile function. How to ???

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=1506
Printed Date: 04 Apr 26 at 7:25PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: MergeFile function. How to ???
Posted By: thangnvhl
Subject: MergeFile function. How to ???
Date Posted: 30 Jun 10 at 10:52AM
My code is bellow:

private PDFLibrary PDFLib = new PDFLibrary();
string sOutputFile = @"C:\my temp\test.pdf";
string sSecondFile = @"C:\my temp\secondfile.pdf";
string sImageFile = @"C:\my temp\thirdfile.jpg";

PDFLib.SaveToFile(sOutputFile);
PDFLib.MergeFiles(sOutputFile, sSecondFile, sOutputFile)
PDFLib.AddImageFromFile(sImageFile, 0);
PDFLib.DrawImage(10, 10, PDFLib.PageWidth() - 10, PDFLib.PageWidth() - 10);

After execute application successfully, My Output File's content is bank.
I don't know what wrong I did. Please help me.

Thank you so much!



Replies:
Posted By: Ingo
Date Posted: 01 Jul 10 at 6:37AM
Hi!

I think you have a load before the SaveToFile ...
MergeFiles works only on disk... so the first Load
(with the old sOutputFile) is still active...
So AddImage doesn't touch the new sOutputFile but the old sOutputFile...
the old sOutputFile wasn't saved at the end - so the image is lost.
Your sequence is wrong ;-)
Please read the first threads in the general section from debenu...
There are knowledgebase- and sample-sections on the official supportpages.

Cheers, Ingo




Posted By: thangnvhl
Date Posted: 06 Jul 10 at 8:51AM
Dear Ingo,
Thanks for your reply, I solve my problem by using MergeDocument()

Regards,



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