[api-dev] New PDF Options being Ignored - ie FirstPagOnLeft, PageLayout, IsSkipEmptyPages
Has anyone had any success using the New pdf properties programmatically? I can't find much documenation, so I tried to use XStore and pass in the properies, but they seem to be ignored. I am using 2.0.3+ (build OOD680_m1) Here is basically what I am doing: XStorable xStore = ( XStorable ) UnoRuntime.queryInterface( XStorable.class, document ); xStore.storeToURL( normaliseFileURL( file.getAbsolutePath() ), properties ); ### Properties pdfProperty[ 0 ] = new PropertyValue(); pdfProperty[ 0 ].Name = FilterName; pdfProperty[ 0 ].Value = writer_pdf_Export; pdfProperty[ 1 ] = new PropertyValue(); pdfProperty[ 1 ].Name = Overwrite; pdfProperty[ 1 ].Value = new Boolean( overwrite ); pdfProperty[ 2 ] = new PropertyValue(); pdfProperty[ 2 ].Name = FirstPageOnLeft; pdfProperty[ 2 ].Value = Boolean.TRUE; pdfProperty[ 3 ] = new PropertyValue(); pdfProperty[ 3 ].Name = UseTaggedPDF; pdfProperty[ 3 ].Value = new Integer(3); any help would be grand. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] New PDF Options being Ignored - ie FirstPagOnLeft, PageLayout, IsSkipEmptyPages
Kent Gibson wrote: Has anyone had any success using the New pdf properties programmatically? I can't find much documenation, so I tried to use XStore and pass in the properies, but they seem to be ignored. I am using 2.0.3+ (build OOD680_m1) Here is basically what I am doing: XStorable xStore = ( XStorable ) UnoRuntime.queryInterface( XStorable.class, document ); xStore.storeToURL( normaliseFileURL( file.getAbsolutePath() ), properties ); ### Properties pdfProperty[ 0 ] = new PropertyValue(); pdfProperty[ 0 ].Name = FilterName; pdfProperty[ 0 ].Value = writer_pdf_Export; pdfProperty[ 1 ] = new PropertyValue(); pdfProperty[ 1 ].Name = Overwrite; pdfProperty[ 1 ].Value = new Boolean( overwrite ); pdfProperty[ 2 ] = new PropertyValue(); pdfProperty[ 2 ].Name = FirstPageOnLeft; pdfProperty[ 2 ].Value = Boolean.TRUE; pdfProperty[ 3 ] = new PropertyValue(); pdfProperty[ 3 ].Name = UseTaggedPDF; pdfProperty[ 3 ].Value = new Integer(3); Filter specific properties are to be placed within a property sequence called FilterData. Your code should look as follow: final PropertyValue aFilterData[] = new ProperyValue[2]; aFilterData[ 0 ] = new PropertyValue(); aFilterData[ 0 ].Name = FirstPageOnLeft; aFilterData[ 0 ].Value = Boolean.TRUE; aFilterData[ 1 ] = new PropertyValue(); aFilterData[ 1 ].Name = UseTaggedPDF; aFilterData[ 1 ].Value = new Integer(3); pdfProperty[ 0 ] = new PropertyValue(); pdfProperty[ 0 ].Name = FilterName; pdfProperty[ 0 ].Value = writer_pdf_Export; pdfProperty[ 1 ] = new PropertyValue(); pdfProperty[ 1 ].Name = Overwrite; pdfProperty[ 1 ].Value = new Boolean( overwrite ); pdfProperty[ 2 ] = new PropertyValue(); pdfProperty[ 2 ].Name = FilterData; pdfProperty[ 2 ].Value = aFilterData; Best regards, Sven any help would be grand. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] New PDF Options being Ignored - ie FirstPagOnLeft, PageLayout, IsSkipEmptyPages
Hi Kent, On 8/31/06, Kent Gibson [EMAIL PROTECTED] wrote: Has anyone had any success using the New pdf properties programmatically? I can't find much documenation, so I tried to use XStore and pass in the properies, but they seem to be ignored. This one: http://specs.openoffice.org/appwide/pdf_export/PDFExportDialog.odt is the main spec, updated July, 31st, and this attachement to issue 67578, http://www.openoffice.org/nonav/issues/showattachment.cgi/37895/draft-doc-pdf-security.odt where I added some documentation not in spec document, especially filter parameters related to security. These are waiting to be embedded in more well dressed documentation. I didn't check your code, but the following basic code fragments is what I worked with: /'codestart 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 DoExport ' now export it oExpOptions = Array(_ MkPropVal( FilterName, writer_pdf_Export ),_ MkPropVal( FilterData, oExpFilterOptions )_ ) oDoc = ThisComponent aURL = oDoc.getLocation() aURL = aURL + -macro.pdf ' add a pdf file type ' Save the document in the new destination format. oDoc.storeToURL( aURL, oExpOptions ) end sub Sub CheckPDFFilterProperties() ' test the filter properties, using the current document as document ' to export ' prepare export filter options, specify only the different from default ' if the options is not specified the application default will be used ' if no filter option is given (e.g. no FilterData property), the last user setting will be used ' see spec for details ' to test: get the name from the specification (or manual ?) ' from their name build a property array ' check the value of any of them and see in acro reader how they behave ' the following is a test setting oExpFilterOptions = Array(_ MkPropVal( InitialView, 0 ),_ MkPropVal( PageLayout, 0 ),_ MkPropVal( UseTaggedPDF, False ),_ MkPropVal( EncryptFile, True ),_ MkPropVal( DocumentOpenPassword, open ),_ MkPropVal( RestrictPermissions, True ),_ MkPropVal( PermissionPassword, permission ),_ MkPropVal( Printing, 24 ),_ MkPropVal( Changes, 4 ),_ MkPropVal( EnableCopyingOfContent, True ),_ MkPropVal( EnableTextAccessForAccessibilityTools, True )_ ) DoExport End Sub Sub Main CheckPDFFilterProperties 'the following four call are for text 'SecPDFCase1 'SecPDFCase2 'SecPDFCase3 SecPDFCase4 'WriteSecDefault End Sub '/=code end I think you have to trim it a little, because it's a not very clean code. -- Hope it helped, Kind regards, Giuseppe Castagno - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]