I am using Interop.Word.Document to convert a Word document to PDF.
It is working fine for me, unless the document has a digital signature, which is not present in the final PDF.
Is there any parameter or line of code that must be added so the signature or signature drawing is not lost?
obs: no problem if the signature is "lost", the expected result it is that the signature or graphic representation of the signature can be seen visually, it would be good.
Update
Private Sub ConvertWordToPDF(filename As String)
Dim wordApplication As New Microsoft.Office.Interop.Word.Application
Dim wordDocument As Microsoft.Office.Interop.Word.Document = Nothing
Dim outputFilename As String
Try
wordDocument = wordApplication.Documents.Open(filename)
outputFilename = System.IO.Path.ChangeExtension(filename, "pdf")
If Not wordDocument Is Nothing Then
wordDocument.ExportAsFixedFormat(outputFilename, Microsoft.Office.Interop.Word.WdExportFormat.wdExportFormatPDF, True, Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForOnScreen, Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, 0, 0, Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, True, True, Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, True, True, False)
End If
Catch ex As Exception
'TODO: handle exception
Finally
If Not wordDocument Is Nothing Then
wordDocument.Close(False)
wordDocument = Nothing
End If
If Not wordApplication Is Nothing Then
wordApplication.Quit()
wordApplication = Nothing
End If
End Try
End Sub
I also verify that if the pdf is saved or exported from word, the digital signature is deleted, but if the print to pdf option is used, the image of the signature is kept.
They will know of any library to print virtual to pdf that is free or open source.
Update: the digital signature, in this case it would be the image of a signature, it is desired to be kept visible as an image or similar. It does not matter if the signature concept is lost and it only becomes an image.
Thank you,