Print Page | Close Window

DA Function

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=1252
Printed Date: 01 Mar 26 at 7:04AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DA Function
Posted By: Dario
Subject: DA Function
Date Posted: 20 Oct 09 at 8:26PM
I'm working with the DAFunction like DASetInformation, DAOpenFile, DAGetInformation. I call the functions within a Thread, and the function often doesn't work! If I use the normal function like GetInformation or SetInformation 80% of my PDF are broken. Are there any informations about?
The same code with the same PDF 5 time works and 1 doesn't work with DA Function. Are there any tricks? The normal functions (NOT DA) works only with little PDF (0-400Mbyte), but they work very well. With DA function instead, I have a lot of problems....
Thanks for any informations



Replies:
Posted By: Ingo
Date Posted: 21 Oct 09 at 7:02AM
Hi Dario!

In the last six years i've done a lot with pdf-documents and the biggest file i've ever had was 262 mbytes. If your small files have a range up to 400 mbytes ... how big are the files you're working with the da-functions? Perhaps your problem is a timing problem? Do you wait calling a function again until you get the result from the previous call? If not: Do it ;-)

Cheers, Ingo



Posted By: Dario
Date Posted: 21 Oct 09 at 10:44AM
OK, but the problems there are even with small files.
You said to wait for the process, how? The thing incredible is that I use the feel back 0 or 1 for to see if the functio work good, and the aswer is always 1 (all ok) but if I set two propriety like "Subect" and "Title" in the same sub, often I have only one propriety setting ok, and often the second line of code. I use the ActiveX 0716 version and all code is BWR Thread in VB.Net
See below:
 

Try

Dim Cartella2DTEMP As New System.IO.DirectoryInfo(PathConverti2OffSetTemp)

If Not Cartella2DTEMP.Exists Then Cartella2DTEMP.Create()

Dim ThreadFILE2 As System.IO.FileInfo = Nothing

Dim FilePDF2DElaborato As String = Nothing

For Each ThreadFILE2 In Cartella2DTEMP.GetFiles

If UCase(ThreadFILE2.Extension) = ".PDF" Then

If Not (ThreadFILE2.Attributes And FileAttributes.System) = FileAttributes.System And Not (ThreadFILE2.Attributes And FileAttributes.Hidden) = FileAttributes.Hidden Then

Dim Nome2Dps As String = ThreadFILE2.Name.Substring(0, ThreadFILE2.Name.Length - 4)

If Nome2Dps.Substring(0, 3) = "1D_" Or Nome2Dps.Substring(0, 3) = "2D_" Then Nome2Dps = Nome2Dps.Substring(6, Nome2Dps.Length - 6)

FilePDF2DElaborato = PathConverti2Scan & "OFFSET\OUT\" & ThreadFILE2.Name.Substring(0, ThreadFILE2.Name.Length - 3) & "PDF"

FileOpen(1, ThreadFILE2.FullName, OpenMode.Binary)

FileClose(1)

Dim QUICKPDF_Doc As New QuickPDFAX0716.PDFLibrary

QUICKPDF_Doc.UnlockKey(Licenza)

Dim HandlerFILE As Long = QUICKPDF_Doc.DAOpenFile(ThreadFILE2.FullName, "")

Risultato = QUICKPDF_Doc.DASetInformation(HandlerFILE, "Title", Nome2Dps)

If Risultato = 0 Then

.........

Exit Try

End If

Risultato = QUICKPDF_Doc.DASetInformation(HandlerFILE, "Subject", "2")

If Risultato = 0 Then

.....

Exit Try

End If

Risultato = QUICKPDF_Doc.DASetInformation(HandlerFILE, "Producer", "ProXFLOW " & My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build & "." & My.Application.Info.Version.MinorRevision)

If Risultato = 0 Then

.....

Exit Try

End If

If System.IO.File.Exists(FilePDF2DElaborato) Then System.IO.File.Delete(FilePDF2DElaborato)

Risultato = QUICKPDF_Doc.DASaveAsFile(HandlerFILE, FilePDF2DElaborato)

If Risultato = 1 Then System.IO.File.Delete(ThreadFILE2.FullName)

End If

Else

If Not (ThreadFILE2.Attributes And FileAttributes.System) = FileAttributes.System And Not (ThreadFILE2.Attributes And FileAttributes.Hidden) = FileAttributes.Hidden Then

FileOpen(1, ThreadFILE2.FullName, OpenMode.Binary)

FileClose(1)

If System.IO.File.Exists(PathConverti2Err & ThreadFILE2.Name) Then System.IO.File.Delete(PathConverti2Err & ThreadFILE2.Name)

System.IO.File.Move(ThreadFILE2.FullName, PathConverti2Err & ThreadFILE2.Name)

End If

End If

Next

Catch When Err.Number = 75

Exit Try

.....

Catch

End Try

where am I wrong? I hevn't any exception....
Thanks for ay information



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