|
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
|