Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Kaustubh Katdare

    @thebigk • Mar 8, 2015

    Pooja ShreeVatsaI have few Data in Jpg I want to convert into excel....I wrote code but its not working ๐Ÿ˜”....someone Help me pls....

    Curious to know if you are actually trying to convert data available in an image (.jpg) to an excel file? If yes, please share the code you've written so far so that the experts here can help you fix it.

    PS: Please create a new discussion for every new topic that you wish to discuss.

  • Koushal Patel

    @koushal-C6mEgp • Mar 8, 2015

    Interesting!
    I have not tried though, found below links
    1. #-Link-Snipped-#
    2. #-Link-Snipped-#

    I will try to do this stuff once I get time, meanwhile, if anyone can pitch in with their idea, we would love to hear.

  • Pooja ShreeVatsa

    @pooja-shreevatsa-9yFvbt • Mar 8, 2015

    Kaustubh KatdareCurious to know if you are actually trying to convert data available in an image (.jpg) to an excel file? If yes, please share the code you've written so far so that the experts here can help you fix it.

    PS: Please create a new discussion for every new topic that you wish to discuss.
    Kaustubh KatdareCurious to know if you are actually trying to convert data available in an image (.jpg) to an excel file? If yes, please share the code you've written so far so that the experts here can help you fix it.

    PS: Please create a new discussion for every new topic that you wish to discuss.

    This s ma code .....

    import java.io.FileOutputStream;
    import com.itextpdf.text.Document;
    import com.itextpdf.text.pdf.PdfWriter;
    import com.itextpdf.text.Image;
    
    
    public class ImageToPDF {
      public static void main(String ... args) {
        Document document = new Document();
        String input = "c:/temp/capture.png"; // .gif & .jpg
        String output = "c:/temp/capture.pdf"; // png to pdf(output file)
        try {
          FileOutputStream fos = new FileOutputStream(output);
          PdfWriter writer = PdfWriter.getInstance(document, fos);
          writer.open();
          document.open();
          document.add(Image.getInstance(input));
          document.close();
          writer.close();
        }
        catch (Exception e) {
          e.printStackTrace();
        }
      }
    }
    
  • Pooja ShreeVatsa

    @pooja-shreevatsa-9yFvbt • Mar 8, 2015

    Kaustubh KatdareCurious to know if you are actually trying to convert data available in an image (.jpg) to an excel file? If yes, please share the code you've written so far so that the experts here can help you fix it.

    PS: Please create a new discussion for every new topic that you wish to discuss.

    Can i Try it in Base64 String?...will i get proper output...

  • Manish Goyal

    @manish-r2Hoep • Mar 9, 2015

    I will suggest you following to debug this problem

    1st create a simple program to create a basic PDF through Java

    Below is working code

    <a href="https://www.avajava.com/tutorials/lessons/how-do-i-write-to-a-pdf-file-using-itext.html" target="_blank" rel="nofollow noopener noreferrer">How do I write to a PDF file using iText? - Web Tutorials - avajava.com</a>

    2: Write a Program to read data from Image, I think a simple read operation should work.

    3: Then merge both program and try to understand what is going wrong at every single point

    Just check if input is coming correctly or not

  • Pooja ShreeVatsa

    @pooja-shreevatsa-9yFvbt • Mar 9, 2015

    Manish GoyalI will suggest you following to debug this problem

    1st create a simple program to create a basic PDF through Java

    Below is working code

    <a href="https://www.avajava.com/tutorials/lessons/how-do-i-write-to-a-pdf-file-using-itext.html" target="_blank" rel="nofollow noopener noreferrer">How do I write to a PDF file using iText? - Web Tutorials - avajava.com</a>

    2: Write a Program to read data from Image, I think a simple read operation should work.

    3: Then merge both program and try to understand what is going wrong at every single point

    Just check if input is coming correctly or not

    Thank you soo Much for your help....I ll try this..