Print Page | Close Window

MergeFileList problem

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=258
Printed Date: 12 May 24 at 12:31AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: MergeFileList problem
Posted By: bogey
Subject: MergeFileList problem
Date Posted: 12 Jan 06 at 9:50AM

I am attempting to rewrite the pdf merge process I have been using to use the MergeFileList() in the file system instead of using the MergeDocument() in memory.

First I am creating the file list using the QP.AddToFileList("pdflist","D:/document/007822.pdf"), etc..

Then I call the QP.MergeFileList("pdfList","d:/temp/12345.pdf")

I get results code of 0 on the merge process. I suspect it is a permissions issue. I have granted iusr_ account full access to the folder. Is there something else I need to do?




Replies:
Posted By: Ingo
Date Posted: 12 Jan 06 at 12:04PM
Hi!

Please have a look at "samples".

Best regards,
Ingo


Posted By: tallen14218
Date Posted: 25 Jan 06 at 10:55AM

Ingo,

Any more specifics? I looked at the Sample Code Forum on this site and there does not seem to be anything related to MergeFileList or MergeFileListFast.

I looked at the knowledgebase on the iSED site and there is also no sample code for MergeFileList or MergeFileListFast.

What "samples" are you referring to?

Tom



-------------
Tom


Posted By: bogey
Date Posted: 25 Jan 06 at 11:06AM

There are no samples of this code on the sedtech site.

 

Here is the basics with some debugging code added...

'Start QP Process
Set QP = Server.CreateObject("iSED.QuickPDF")
Call QP.UnlockKey("xxxxxxxxxxxxxxxxxxxxxxxxxxx")
QP.SetTempPath("d:/temp")
QP.SetTempFile("d:/temp/pdftemp.dat")
response.write("<br>Check Temp Path = " & QP.TestTempPath()) 

call QP.AddToFileList("pdfList","d:\pdf\file1.pdf))
call QP.AddToFileList("pdfList","d:\pdf\file2.pdf))
call QP.AddToFileList("pdfList","d:\pdf\file3.pdf))

thisDoc = "d:/temp/" & Session.SessionID & "-" & timer * 100 & ".pdf"

response.write("<br>Merging File List to " & thisDoc & " = " & QP.MergeFileListFast("pdfList",thisDoc))

Once this is complete you can then load the merged PDF to memory, insert form data, change properties, secure and compress it, and then stream it to the browser.

QP.LoadFromFile(thisDoc)

response.write("<br>Total Page Count = " & QP.PageCount())

call QP.SetInformation(1,"whoever")  'Author
call QP.SetInformation(2,"title")  'Title
call QP.SetInformation(3,"subject")  'Subject
call QP.SetInformation(4,"")  'KeyWords
call QP.SetInformation(5,"creator")  'Creator
call QP.SetInformation(6,Request.ServerVariables("SERVER_NAME")) 

permissions=QP.Permissions(1,0,0,1,1,0,1,1)

'encrypt 40 bit for compatibility with acrobat 3 and 4
call QP.Encrypt(PDFPassword,"",0,permissions)
Call QP.CompressContent()
'output any error codes
fncDebug("<br>Error Code = " & QP.LastErrorCode())

Response.ContentType = "application/pdf"
Response.AddHeader "Content-disposition",  "inline; filename=" & timer * 100 & ".pdf"
Response.BinaryWrite QP.SaveToVariant()

 


 



Posted By: JanN
Date Posted: 25 Jan 06 at 11:10AM
Forget this post. We both have written at the same time. Your post made my suggestions needless... :)


Posted By: JanN
Date Posted: 25 Jan 06 at 11:16AM
bogey,

which value does QP.LastErrorCode return if placed after QP.MergeFileListFast?


Posted By: bogey
Date Posted: 25 Jan 06 at 11:19AM
LastErrorCode should return 0


Posted By: JanN
Date Posted: 25 Jan 06 at 11:31AM
Documentation: "A new file list will be created during merging that will contain the result of the merge process for each of the items in the specified file list. The new file list will have the same name as the original file list with the word Result appended. For example, if the original file list was called "MyFiles", then the new file list will be called "MyFilesResult". This new file list will not contain file names, but will contain a text description of the status of the matching file during the merge process."

Try to read the new list "pdfListResult" with these functions: FileListCount, FileListItem

Perhaps they tell what happens...


Posted By: tallen14218
Date Posted: 25 Jan 06 at 11:33AM

LastErrorCode is 999 when I attempt to merge 2 400KB files using MergeFileList.

LastErrorCode is 0 when I attempt to merge 2 400KB files using MergeFileList.

In both cases, no merge file is created and the merged file count returned is always 0.

Tom

 

 



-------------
Tom


Posted By: tallen14218
Date Posted: 25 Jan 06 at 11:44AM

Aah, I see the error of my ways.

I was using 2 different instances of a PDF object - I use the first instance to create and write each individual PDF and the second instance to manage the FileList and then finally the merge.

I was unlocking the first instance with my unlock code but not hte second instance.

MergeFileListFast worked great once I got my head screwed on right.

Thanks Jan and bogey.

Tom

 



-------------
Tom



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