Converting documents to images using OpenOffice API

Is it possible to convert e.g. a Word document into a TIFF image using the OpenOffice API with JAI? If so, any pointers as to how this would be done?
Thanks,
Harri

Oops... I didn't notice that you mentioned all that Microsoft stuff. The answer is still yes, I think, but you might want to look into some other language than Java.

Similar Messages

  • Idea  about convert word document to pdf using java api

    idea about convert word document to pdf using java api if any one find it mail me at [email protected]

    api if any one find it mail me at
    [email protected]
    What happend to your other mailID :
    [email protected] ????
    http://forum.java.sun.com/thread.jspa?threadID=639851&
    messageID=3756910It received the Spam Of Death. RIP

  • Image resolution for converted documents and images

    We are converting documents from several different formats to PDF.  We have a requirement that the images must be 300 dpi when converted.  I turned off the down sampling option in PDF settings.  However, the images are all coming out at 72 dpi. So I have some questions.
    Is there a way to control the dpi of a converted image?
    How about an image embedded in a document?
    Is there any easy way to check the dpi of an image in a PDF?  The only way I've found to check the image dpi is use preflight in Acrobat.
    -Kelly

    No good.
    I've followed the instructions 3 times to the letter and it still opens without any mention of a password request. In fairness, its exactly the same process I followed with the Google instructions so I am at a complete loss with this one.
    Maybe my Macbook is configured wrong somewhere. I'll have to take it in to the Apple Store when I can get up there and see if they can work it out.
    Thanks for the assist anyway Allan, I'm sure I'll get it working one way or another
    Maffstar

  • How can you stretch an image using JMF API

    How is it possible to strech or zoom the video using JMF API? Streching may not distort the resolution, but, zooming might as I imagiine.

    You can zoom with something like this:
    public void zoomTo(float z) {
         if (visualComp != null) {
              insets = getInsets();
              Dimension d = visualComp.getPreferredSize();
              d.width = (int) (d.width * z);
              d.height = (int) (d.height * z);
              if (controlComp != null)
              d.height += controlComp.getPreferredSize().height;
              setSize(d.width + insets.left + insets.right,
                   d.height + insets.top + insets.bottom);
    }I suposse visualComp is the visualComponent of a player and this zoomTo(..) method is in a Component so you can call to setSize(..) method.
    Of course the float z is the scale of zoom.
    ... i hope!

  • How to generate the "validate image" using APEX API ?

    I don't konw whether APEX has some API function using to generate image, and draw anything on it freely :-), such as LINE, TEXT or RECTANGLE ?

    Apex has no built in tools for creating GIF or JPEG images no.
    You may have some success looking for some java code that will do this for you, then you can load that java class into the database, write some PL/SQL wrappers around it then you will be able to call it from within your Apex application.

  • How to convert JPEG - PNG images using java?

    Hi,
    Has anyone done this before?
    Can you provide me with a sample code or point me to the direction on how this can be done?
    Are there any existing Java technology that supports this?
    Most grateful. Thanks.

    It's should be easy using Java Advanced Imaging (JAI). Try this.
    import javax.media.jai.JAI;
    import javax.media.jai.RenderedOp;
    public class convert {
      static public void main(String[] args) {
        String inName = args[0];
        String outName = args[1];
        RenderedOp source = JAI.create("fileload", inName);
        JAI.create("filestore", source, outName, "PNG", null);
        System.exit(0);
    }

  • How do I copy an art object from one document to another using illustrator API(C  )

    Hi, I'm trying to copy text and graphic elements from one document into another, does anybody has an idea how to do it using Illustrator SDK(C++)?
    Thanks in advance.

    If you call AIArtSuite::ReorderArt() giving the layer group handle from the target document and using art from the source document, it will move art between documents. That said, there are all sorts of caveats that come along with that -- some things move over automatically (graphic styles, symbols) while others cause problems. E.g. copying art that contains a swatch can cause a crash when you shut down the source document because it may keep the style reference to the swatch in the source document -- which goes away when the document is closed. Gradients in particular are a problem I believe. Straight up colours are (I think) fine. I've had to write a lot of workarounds for various headaches caused by moving art between documents.
    Bottom line: its very doable, but there are a lot of edge cases. This was clearly not an intended use of the SDK, though it is possible.

  • How to retain the same resolution while croping a tiff image using jai api

    Hi all,
    I have designed a program to crop a tiff image.But after croping the tiff,the resultant file resolution is not the same as the original source file.
    In the program,the source file Nadeshiko_v1_02.tif has the resolution(X) of 1200 DPI and resolution(Y) has 1200 DPI pixels.
    But after croping the resolution of output file is 100 DPI.
    Please give me some idea on how to retain the same resolution.
    <code>
    package jai;
    import java.awt.Frame;
    import java.awt.image.RenderedImage;
    import java.awt.image.renderable.ParameterBlock;
    import java.awt.image.renderable.RenderableImage;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.imageio.*;
    import javax.imageio.stream.ImageOutputStream;
    import javax.media.jai.Interpolation;
    import javax.media.*;
    import javax.media.jai.JAI;
    import javax.media.jai.PlanarImage;
    import javax.media.jai.RenderedOp;
    import javax.media.jai.widget.ScrollingImagePanel;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.TIFFEncodeParam;
    import javax.media.jai.OperationDescriptorImpl;
    import java.io.*;
    import java.util.Iterator;
    import javax.media.jai.operator.*;
    // import javax.media.jai.widget.ScrollingImagePanel;
    public class crop {
              /** The main method. */
    public static void main(String[] args) {
    /* Validate input. */
    /* if (args.length != 1) {
    System.out.println("Usage: java JAISampleProgram " +
    "input_image_filename");
    // System.exit(-1);
    float a=(float) 70.3;
    float b=(float) 70.4;
    float c=(float) 3100.3;
    float d=(float) 5522.4;
    * Create an input stream from the specified file name
    * to be used with the file decoding operator.
    String TIFF="TIFF";
    FileSeekableStream stream = null;
    try {
         stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_02.tif");
    // stream = new FileSeekableStream("D:\\tif images\\Nadeshiko_v1_01.jpg");
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(0);
    // Load the source image from a Stream.
    RenderedImage im = JAI.create("stream", stream);
    RenderedImage image2= CropDescriptor.create(im, a, b, c, d, null);
    ScrollingImagePanel panel = new ScrollingImagePanel(image2, 100, 100);
    // Create a frame to contain the panel.
    Frame window = new Frame("JAI Image Cropping");
    window.add(panel);
    window.pack();
    // window.show();
    // Define the source and destination file names.
    // String inputFile = "D:\\tif images\\Nadeshiko_v1_05.tif";
    String outputFile = "D:\\tif images\\Nadeshiko_v1_04.tif";
    // Save the image on a file. We cannot just store it, we must set the image encoding parameters
    // to ensure that it will be stored as a tiled image.
    TIFFEncodeParam tep = new TIFFEncodeParam();
    tep.setWriteTiled(true);
    tep.setTileSize(80,80);
    JAI.create("filestore",image2,outputFile,"TIFF",null);
    try {
                   stream.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    </code>
    Thanks,
    Sanat Meher

    Try the following,
    TIFFEncodeParam tep = new TIFFEncodeParam();
    // Create {X,Y}Resolution fields.
    TIFFField fieldXRes = new TIFFField(0x11A, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_X, 1}});
    TIFFField fieldYRes = new TIFFField(0x11B, TIFFField.TIFF_RATIONAL,
                                        1, new long[][] {{DPI_Y, 1}});
    tep.setExtraFields(new TIFFField[] {fieldXRes, fieldYRes});

  • Access metadata and images using Lightroom API

    It would be great to access the images in the Lightroom library from outside Lightroom (including all post-processing of course). This would enable 3rd party applications to integrate the library into the application. This is especially useful for media centers.

    You would really need a shared catalog and image files on an external hard dive. Then connect the ehd to either machine, as needed.
    I personally use a master catalog on my desktop machine and a travel catlog on my Macbook pro. That lets me shoot photos, apply metadata and edit them on the road and when I get home I simply import the travel catalog into the combined master catalog.
    This video tutorial from Adobe Evangelist Julieanne Kost gives a demonstration of how to use a travel catalog on-location.
    http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/how-to-use-lightroom-5- on-location/

  • Text looks jagged when converting PDF to image using Cocoa on Leopard

    Hello,
    I have a program that composites the pages of a PDF into a single image with each page stacked on top of each the previous one. The program works fine, but the font rendering quality is much lower when run from anything but a Snow Leopard system. In Leopard, the text looks jagged and not antialiased properly. Does anyone know a fix for this? Here is my code.
    NSString* path = [[oPanel filenames] objectAtIndex: 0];
    NSPDFImageRep *pdf = [NSPDFImageRep imageRepWithContentsOfFile: path];
    int pageHeight = 765;
    int pageWidth = 990;
    int pages = [pdf pageCount];
    int height = pageHeight * pages;
    NSImage *compositeImage = [[NSImage alloc] initWithSize:NSMakeSize(pageWidth, height)];
    [compositeImage lockFocus];
    for (int i = 0; i < pages; i++) {
    [pdf setCurrentPage: i];
    NSImage *page = [[NSImage alloc] init];
    [page addRepresentation:pdf];
    NSSize size = [pdf bounds].size;
    int width = round(pageHeight * size.width / size.height);
    [page drawInRect: NSMakeRect(0, height - pageHeight * (i + 1), width, pageHeight)
    fromRect: NSZeroRect
    operation: NSCompositeSourceOver
    fraction: 1.0];
    [page release];
    [compositeImage unlockFocus];
    NSBitmapImageRep *rep = [NSBitmapImageRep imageRepWithData: [compositeImage TIFFRepresentation]];
    NSData *imageData = [rep representationUsingType: NSJPEGFileType properties: nil];
    [imageData writeToFile:@"/Users/devongovett/Desktop/out.jpg" atomically: YES];
    Thanks for any help you might be able to give!
    Devon
    Message was edited by: devongovett
    Message was edited by: devongovett

    devongovett wrote:
    The program works fine, but the font rendering quality is much lower when run from anything but a Snow Leopard system. In Leopard, the text looks jagged and not antialiased properly.
    Without knowing anything about how to draw into a PDF in code: the problem might not be in your code but in Leopard's rendering.
    I bet you are testing just with Apple's own Preview app -- can you test with something else, for example, the Acrobat Reader, on both systems? There is a good chance your image is just fine.

  • Openoffice api converted pdf not loading using acrobat viewer

    While i used AcrobatFaxProducer of RFAX component java api which in turn uses Acrobat.jar and MRJToolkit to support pdf documents to fax.
    but you know while I tried to fax a pdf document which is being converted from word file using openoffice api, I got an error as follows:--
    Kindly requested to revert back with a solution for this.
    com.adobe.acrobat.sidecar.FontException:Corrupted or unrecognized font ().
    at com.adobe.acrobat.sidecar.AWTOutlines.doAWTOutlines(AWTOutlines.java:
    at com.adobe.acrobat.sidecar.AWTOutlines.<init>(AWTOutlines.java:351)
    at com.adobe.acrobat.pdf.PDFFont.<init>(PDFFont.java:1490)
    at com.adobe.acrobat.pdf.VPDFFontInstance.computePDFFont(VPDFFont.java:3
    at com.adobe.acrobat.pdf.VPDFFont.computeObject(VPDFFont.java:146)
    at com.adobe.pe.notify.VValuePurgeable.compute(VValuePurgeable.java:76)
    at com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
    at com.adobe.pe.notify.VValuePurgeable.objectValue(VValuePurgeable.java:
    at com.adobe.acrobat.pdf.VPDFFont.pdfFontValue(VPDFFont.java:128)
    at com.adobe.acrobat.pdf.VPDFFontByRef.computePDFFont(VPDFFont.java:260)
    at com.adobe.acrobat.pdf.VPDFFont.computeObject(VPDFFont.java:146)
    at com.adobe.pe.notify.VValuePurgeable.compute(VValuePurgeable.java:76)
    at com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
    at com.adobe.pe.notify.VValuePurgeable.objectValue(VValuePurgeable.java:
    at com.adobe.acrobat.pdf.VPDFFont.pdfFontValue(VPDFFont.java:128)
    at com.adobe.acrobat.pdf.VPDFFontByName.computePDFFont(VPDFFont.java:215
    at com.adobe.acrobat.pdf.VPDFFont.computeObject(VPDFFont.java:146)
    at com.adobe.pe.notify.VValuePurgeable.compute(VValuePurgeable.java:76)
    at com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
    at com.adobe.pe.notify.VValuePurgeable.objectValue(VValuePurgeable.java:
    at com.adobe.acrobat.pdf.VPDFFont.pdfFontValue(VPDFFont.java:128)
    at com.adobe.acrobat.pdf.Funct_cTJ.computeOffsetsAndString(TextExecuter.
    9)
    at com.adobe.acrobat.pdf.Funct_cTJ.setUp(TextExecuter.java:973)
    at com.adobe.acrobat.page.ContentParser.executeLiteral(ContentParser.jav
    at com.adobe.acrobat.page.ContentParser.churn(ContentParser.java:101)
    at com.adobe.acrobat.page.ContentArray.doSomeComputing(ContentArray.java
    at com.adobe.acrobat.page.ContentArray.thereIsContentAt(ContentArray.jav
    at com.adobe.acrobat.page.ContentArray.draw(ContentArray.java:239)
    at com.adobe.acrobat.page.ContentArray$1.draw(ContentArray.java:63)
    at com.adobe.acrobat.PDFDocument.drawPage(PDFDocument.java:191)
    at com.java4less.rfax.AcrobatFaxProducer.createImage(AcrobatFaxProducer.
    4)
    at com.java4less.rfax.AcrobatFaxProducer.getFaxPage(AcrobatFaxProducer.j
    at com.java4less.rfax.FaxModem.createFaxFiles(FaxModem.java:422)
    at com.java4less.rfax.FaxModem.open(FaxModem.java:489)
    at AcrobatFax.main(AcrobatFax.java:63)

    Hi anaghad,
    You can deduce the orientation. Actually the value of the ASFixedRect are [ lower-left x, lower-left y, upper-right x, upper-right y ]. To have the correct value use the ASFixedToInt32 and you will be able to find the orientation of the Media with the length and heigth.
    Use the rotation to change the orientation.
    E.g. MediaBox [0 0 100 400] is portrait. If you have a rotation of 90° in addition it's landscape.
    Regards,
    Joe

  • Problem with converting html to pdf using LiveCycle ES Java API

    I am using this code to convert html to pdf.
    * 1. adobe-generatepdf-client.jar
    * 2. adobe-livecycle-client.jar
    * 3. adobe-usermanager-client.jar
    * 4. adobe-utilities.jar
    * 5. wlclient.jar
    import java.io.File;
    import java.util.Properties;
    import com.adobe.idp.Document;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
    import com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient;
    import com.adobe.livecycle.generatepdf.client.HtmlToPdfResult;
    public class ConvertHTML {
       public static void main(String[] args)
            try{
            //Set connection properties required to invoke LiveCycle ES                             
            Properties connectionProps = new Properties();
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "t3://localhost:7001");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);       
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebLogic");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
            //Create a ServiceClientFactory instance
            ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
              //Create a GeneratePdfServiceClient object
            GeneratePdfServiceClient pdfGenClient = new GeneratePdfServiceClient(factory);
           //Get an HTML document to convert to a PDF document a
            String inputFileName = "http://www.adobe.com";
            //String inputFileName = "C:\\Documents and Settings\\venkat\\Desktop\\Adobe.htm";
            String securitySettings = "No Security";
            String fileTypeSettings = "Standard";
    System.out.println("one");
            //Convert HTML content to a PDF document
            HtmlToPdfResult result = pdfGenClient.htmlToPDF2(inputFileName, fileTypeSettings, securitySettings, null, null);
    System.out.println("two");         
            //Get the newly created document
            Document createdDocument = result.getCreatedDocument();
            //Save the PDF document as a PDF file
            createdDocument.copyToFile(new File("C:\\test.pdf"));
        catch (Exception e) {
            System.out.println("Error OCCURRED: " + e.getMessage());
            e.printStackTrace();
    I can able to compile this class but while running i am getting error like below.
    Error OCCURRED: Internal error.
    ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
    :160)
            at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat
    cher.java:57)
            at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
            at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.htmlToPDF2(GeneratePdfSer
    viceClient.java:666)
            at ConvertHTML.main(ConvertHTML.java:84)
    Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exc
    eption is:
            org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
    java:101)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
    :130)
            ... 4 more
    Caused by: org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
            at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.writeLock(Unknown Source)
            at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendFragment(Unknown Source)
            at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendMessage(Unknown Source)
            at com.sun.corba.se.impl.encoding.CDROutputObject.finishSendingMessage(Unknown Source)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.finishSendingRequest(Unknown Sour
    ce)
            at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(Unkno
    wn Source)
            at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknow
    n Source)
            at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
            at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(Unknown Source)
            at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
            at weblogic.corba.j2ee.naming.Utils.narrowContext(Utils.java:126)
            at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
    oryImpl.java:94)
            at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
    oryImpl.java:31)
            at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41)
            at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
            at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
            at javax.naming.InitialContext.init(Unknown Source)
            at javax.naming.InitialContext.<init>(Unknown Source)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initJndiContext(EjbMessageDispat
    cher.java:213)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.getJndiContext(EjbMessageDispatc
    her.java:226)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
    java:87)
            ... 5 more
    can u plz give me some way to do the convertion.

    Yes Sir.....Thanks for ur suggestion.....
    But i didn't find exact solution..well..yes i found some but not exactly there were not in the way i required...I jus need to convert HTML to PDF using iText API for java.....I already used some classes in that like HTMLParser.....etc..
    So Any thing else...Any one...Sure can help me in this................

  • Printing document /image using flex 4.5.1 - is it possible?

    Hi respected,
    I want to check one fesibility,
    Printing document or image using flex 4.5.1 - is it possible? I want to develope mobile application (ipad) using Adobe 4.5.1 . So is there any way to handle priniting from app. 
    Regards,
    Madhu

    you can't directly add image to printing class, create custom component  class for image first, then add to printing class as component.

  • Drawing an image in excel sheet using HSSF API

    Hi All,
    Can any one please help me.
    I am facing an issue with excel sheet while drawing image using HSSF API.
    I am doing autofit for all the cells i have added. But the image is stretching along with the expanded cells.
    I want the autofit option to work but the image should not stretch. Image should be the same size as is but the cells must expand.
    Thanks in advance

    Hi Santosh
    You can export the report to PDF
    Else you can manually copy the logo\image to excel sheet.
    Hope it will help.
    Regards
    Kultar

  • Convert Canvas to Image in sapui5

    Convert canvas to image using controller in sapui5,I have tried these codes but nothing works..Please help me.
    Here is my code:
    onOkCloseButton : function(oEvent) {
      var view = this.getView();
      var canvas = view.byId("canvas");
    var dataURL = canvas.toDataURL("image/png");
    // var window = window.open();
    // window.document.write('<img src="'+dataURL+'"/>');
    // window.location = (canvas.toDataURL('image/png'));
    // var dataURL = canvas.toDataURL();
    // $.post("http://localhost:31651/Registration_Card/index.html", { img : canvas.toDataURL() }) 
    // .done(function(data) { 
    //  alert("Image Sent to Server "); //on completion 
    // Canvas2Image.saveAsJPEG(canvas);
    // var oImgJPEG = Canvas2Image.saveAsJPEG(canvas, true);
    // Canvas2Image.saveAsPNG(canvas, false, 100, 100);
      oEvent.getSource().getParent().close();

    Ho to save a canvas as an image in J9 and CDC.
    It seems that I already have resolute by means of the tool Jimi de Sun. Anyway I will thank for any new contribution.
    Thanks

Maybe you are looking for