How to use the samples

Last post 07-15-2009, 3:21 AM by Sandy.Zhang. 1 replies.
Sort Posts: Previous Next
  •  07-13-2009, 4:46 AM 188158

    How to use the samples

    Hi!

    I have downloaded the Aspose[1].Pdf.Kit.zip and got the sample java programs. I would like to use PageToImage.java (path = examples\samples\convert\) and would like to create a jsp page to select a PDF file that can be converted to Image using this java code. Can you guide me how to go about it? I am running Tomcat in Windows 2003 server. Can you provide the sample jsp page to show this conversion?

    Thanks.

    RP

     
  •  07-15-2009, 3:21 AM 188489 in reply to 188158

    Re: How to use the samples

    Hi ramit,

     

    If you want to use a jsp page to select a file, you should use the following form:

     

    <form action="…" enctype="multipart/form-data" method="post">

    <p>

           Please specify a file, or a set of files:<br>

           <input type="file" name="datafile" size="40">

    </p>

    <div>

           <input type="submit" value="Send">

    </div>

    </form>

     

    On the server side, you can get the pdf file’s InputStream from the method HttpServletRequest.getInputStream(), then you pass this InputStream to the method PdfConverter.bindPdf(java.io.InputStream inputStream), finally you call the method PdfConverter.getNextImage(HttpServletResponse.getOutputStream(), ImageType imageType) to send the result image to the client.

     

    I have not tested these codes on my machine, but I’m quite sure it will work. You can contact to me if you have any problem.

     

    Thank you for using our product.


    Sandy.Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML