Skip to content
Advertisement

Can’t get a image from resources

I have problem to get an image from another package of my Eclipse project! I saw this post here My code is this CreateTableOnPDF.java:

JavaScript

I getting this exception:

JavaScript

I don’t know what I am doing wrong? Maybe is the a lot hour a have spend already infront of my monitor.

Here is my project structure: enter image description here

Thanks for your attention and time!

Advertisement

Answer

Please check the API docs, you should put JPEG data, not PNG data.

JavaScript

Parameters:

  • doc – The document to create the image as part of.
  • is – The stream that contains the JPEG data.

Throws:

  • IOException – If there is an error reading the JPEG data.
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement