Hello,
This time I downloaded Aspose.PDF to see if I can use it to convert PDF files in PDF/A. Unfortunately, I see, that I have many PDF files Aspose.PDF is unable to convert.
My code snippet is below. Source PDF files I was unable to convert are an attachment.
Could you please tell me if you are able issues I found?
Mikhael
_failed to convert.zip (1.8 MB)
For Each sFile In lst
Try
Dim sPDFFileNameExt = GetFileNameExt(sFile)
Using pdfDocument = New Document(sFile)
Dim sOutDir4File = GetFileDirectory(IO.Path.Combine(sOutFolder, sPDFFileNameExt))
If Not IO.Directory.Exists(sOutDir4File) Then
IO.Directory.CreateDirectory(sOutDir4File)
End If
If pdfDocument.Convert(IO.Path.Combine(sOutFolder, sPDFFileNameExt + " - log.xml"), PdfFormat.PDF_A_1B, ConvertErrorAction.None) Then
pdfDocument.Save(IO.Path.Combine(sOutFolder, sPDFFileNameExt))
Else
Console.WriteLine(">> Failed attempt to convert file: '" + sFile + "'")
End If
End Using
Catch ex As Exception
Console.WriteLine(">>>> " + ex.Message + ". File: '" + sFile + "'")
End Try
Next