Hi Everybody!

I am having problems running a Java program exploiting the UNO interface
in that I cannot export to PDF using the writer_pdf_Export filter. Here is a
code
sniplet which works fine with normal SXW documents but not with SXG
documents.

    public void genPDF() throws java.lang.Exception
    {
        com.sun.star.frame.XStorable storeY =
(com.sun.star.frame.XStorable)UnoRuntime.queryInterface(com.sun.star.frame.X
Storable.class,ourTextDocument);
        PropertyValue[] pdfArgs = new PropertyValue[1];
        pdfArgs[0] = new PropertyValue();
        pdfArgs[0].Name = "CompressMode";
        pdfArgs[0].Value = new Integer(2); // 0 for screen, 1 for print, 2
for highest quality
        PropertyValue[] pArgs = new PropertyValue[3];
        pArgs[0] = new PropertyValue();
        pArgs[0].Name = "FilterName";
        pArgs[0].Value = "writer_pdf_Export";
        pArgs[1] = new PropertyValue();
        pArgs[1].Name = "FilterData";
        pArgs[1].Value = pdfArgs;
        pArgs[2] = new PropertyValue();
        pArgs[2].Name = "Overwrite";
        pArgs[2].Value = Boolean.TRUE;

        String fileName = outputName.replace('\\','/');
        fileName = fileName.substring(0,fileName.lastIndexOf('.'))+".pdf";

        storeY.storeToURL("file:///"+fileName, pArgs);
    }

If I execute this with a SXW document it works fine. If I use the method
with a
SXG documentit throws an IOException. Anybody have an idea what is wrong?


Michael Laun mlaun.com
Elsaesserweg 5
88633 Heiligenberg
Germany


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

Reply via email to