Re: [api-dev] How to set PDF-Export Options via API?

2007-10-24 Thread André Schnabel

Hi Giuseppe & Jürgen,

thanks for the information - I got my tool working.

André

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to set PDF-Export Options via API?

2007-10-24 Thread Giuseppe Castagno

André Schnabel wrote:

Hi,

I working on a little tool to export documents to PDF using OOo-API 
(based on the java file exporter example - my first attemt in OOo 
programming).


Works quite well, but I'd like to set enhanced  export properties like  
ExportBookmarks or  ExportFormFields. I didn't find information about 
that in the SDK. Can anybody give me a int, how to set these options?




you can find information on PDF export filter properties on the filter 
specification [1] (have a look to section 3 Configuration), except the 
security related ones, that are only documented in issue 67578 [2] (look 
for "Filter property values for scripting" without quotes in the 
attached document there).


--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
[EMAIL PROTECTED]
[1] http://specs.openoffice.org/appwide/pdf_export/PDFExportDialog.odt
[2] http://qa.openoffice.org/issues/show_bug.cgi?id=67578#desc2

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to set PDF-Export Options via API?

2007-10-23 Thread Juergen Schmidt

Hi André,

the problem is that these filter specific properties are not documented. 
Well i would like to see some kind of documentation for all filters but 
that is different story.


I have collected additional properties from the sources but can't find 
it at the moment. I have to search again later and i promise that i will 
create wiki page ;-)


Anyway you can set additional filter properties this way:


public static void main(String[] args) {
  try {
// get the remote office component context
XComponentContext xContext = Bootstrap.bootstrap();

XMultiComponentFactory xMCF = xContext.getServiceManager();

XComponentLoader xLoader = (XComponentLoader)
  UnoRuntime.queryInterface(XComponentLoader.class,

xMCF.createInstanceWithContext(
  "com.sun.star.frame.Desktop", xContext));

XTextDocument xDoc = (XTextDocument)UnoRuntime.queryInterface(
  XTextDocument.class, xLoader.loadComponentFromURL(
"private:factory/swriter", "_blank", 0, new PropertyValue[0])); 



xDoc.getText().setString("A simple PDF export test");

//  important code here
PropertyValue[] pdfprops = new PropertyValue[3];
pdfprops[0] = new PropertyValue();
pdfprops[0].Name = "UseTaggedPDF";
pdfprops[0].Value = new Boolean(true);
// well i haven't tested ExportBookmarks and ExportFormFields but i 
assume that they are boolean props too

pdfprops[1] = new PropertyValue();
pdfprops[1].Name = "ExportBookmarks";
pdfprops[1].Value = new Boolean(true);
pdfprops[2] = new PropertyValue();
pdfprops[2].Name = "ExportFormFields";
pdfprops[2].Value = new Boolean(true);

PropertyValue[] props = new PropertyValue[2];
props[0] = new PropertyValue();
props[0].Name = "FilterName";
props[0].Value = "writer_pdf_Export";
props[1] = new PropertyValue();
props[1].Name = "FilterData";
props[1].Value = pdfprops;


XStorable xStorable = (XStorable)UnoRuntime.queryInterface(
  XStorable.class, xDoc);
xStorable.storeToURL("file:///export/TaggedPDFExport.pdf", props);

   XCloseable xCloseable = (XCloseable)UnoRuntime.queryInterface(
 XCloseable.class, xDoc);
   xCloseable.close(false);
 } catch (java.lang.Exception e){
   e.printStackTrace();
 }
 finally {
   System.exit( 0 );
 }
}


André Schnabel wrote:

Hi,

I working on a little tool to export documents to PDF using OOo-API 
(based on the java file exporter example - my first attemt in OOo 
programming).


Works quite well, but I'd like to set enhanced  export properties like  
ExportBookmarks or  ExportFormFields. I didn't find information about 
that in the SDK. Can anybody give me a int, how to set these options?


Thanks in advance,

André

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