Hello
I need to generate a PDF allowing subsequently be signed in Acrobat Reader.
I need to give permissions to someone add a digital signature in a PDF
document.
This is the code that i'm using:
Function MkPropVal( Optional cName As String, Optional uValue ) As
com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MkPropVal() = oPropertyValue
End Function
Sub xml2pdf( org , dest )
cURL = ConvertToURL( org )
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank",
0,Array(MakePropertyValue( "Hidden", True ),))
cURL = ConvertToURL( dest )
' Save the document using a filter.
' oExpFilterOptions = Array(_
' MkPropVal( "InitialView", 0 ),_
' MkPropVal( "PageLayout", 0 ),_
' MkPropVal( "UseTaggedPDF", False ),_
' MkPropVal( "EncryptFile", False ),_
' MkPropVal( "DocumentOpenPassword", "" ),_
' MkPropVal( "RestrictPermissions", False ),_
' MkPropVal( "PermissionPassword", "" ),_
' MkPropVal( "Printing", 2 ),_
' MkPropVal( "Changes", 4 ),_
' MkPropVal( "EnableCopyingOfContent", True ),_
' MkPropVal( "EnableTextAccessForAccessibilityTools", True
)_
' )
oExpFilterOptions = Array(_
MkPropVal( "UseLosslessCompression",true),_
MkPropVal( "Quality",100),_
MkPropVal( "ReduceImageResolution",false),_
MkPropVal( "MaxImageResolution",300),_
MkPropVal( "UseTaggedPDF",false),_
MkPropVal( "ExportNotes",false),_
MkPropVal( "UseTransitionEffects",true),_
MkPropVal( "IsSkipEmptyPages",false),_
MkPropVal( "FormsType",0),_
MkPropVal( "HideViewerToolbar",false),_
MkPropVal( "HideViewerMenubar",false),_
MkPropVal( "HideViewerWindowControls",false),_
MkPropVal( "ResizeWindowToInitialPage",false),_
MkPropVal( "CenterWindow",true),_
MkPropVal( "OpenInFullScreenMode",false),_
MkPropVal( "DisplayPDFDocumentTitle",true),_
MkPropVal( "InitialView",0),_
MkPropVal( "Magnification",0),_
MkPropVal( "PageLayout",0),_
MkPropVal( "FirstPageOnLeft",false),_
MkPropVal( "Printing",2),_
MkPropVal( "Changes",4),_
MkPropVal( "EnableCopyingOfContent",false),_
MkPropVal( "EnableTextAccessForAccessibilityTools",true),_
MkPropVal( "EncryptFile",false),_
MkPropVal( "DocumentOpenPassword",""),_
MkPropVal( "RestrictPermissions", false),_
MkPropVal( "PermissionPassword", "")_
)
oExpOptions = Array(_
MkPropVal( "FilterName", "writer_pdf_Export" ),_
MkPropVal( "FilterData", oExpFilterOptions )_
)
oDoc.storeToURL( cURL, oExpOptions)
oDoc.close( True )
End Sub
Function MakePropertyValue( Optional cName As String, Optional uValue ) _
As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
I export to PDF with openoffice and then i use Acrobat Reader to read the
document.
Acrobat Reader allows a signature to be add to a PDF document if the
property SIGNING is enabel, when the document is created.
The problem is that I can change some properties of the document exemple(add
a password DocumentOpenPassword), but i can't add signature.
Is there any property that allows a signature in PDF document? Or is
something wrong with the code that i´m using?
Thank you for your time
--
Helder Cordeiro
--
Helder Cordeiro