Hey,
I’ve downloaded latest version of Aspose Pdf - 2.5.0.
I have problems with creating images in PDF.
When I try to create image from web url following message is printed:
“file create error!” and CPU usage is 99% all the time.
Using version 2.4.0 the same code works ok.
Is it possible to attach image that is dynamically created by servlet?
In version 2.4.0 when I try to do something like this:
image.getImageInfo().setFile(“http://localhost:8080/app/imageProviderl?width=150&height=100”);
I get exception “format is not supported”
Is it possible to create image from stream in version 2.5.0?
It seems that BinaryFileStream(byte[] arr)
doesn’t work.
Also invoking BinaryFileStream.write(byte b) results in exception “java.lang.UnsupportedOperationException: This stream can’t be wrote”
The only way I could create image in version 2.5.0 is from local file.
I've tested all the scenario and I'm able to notice the problems. For the sake of correction, I've logged them in our issue tracking system. We will look into the details of these problems and will keep updated with the status of correction.
1. When I try to create image from web url following message is printed: "file create error!" and CPU usage is 99% all the time.
I've logged it as PDFJAVA-14913
2. invoking BinaryFileStream.write(byte b) results in exception "java.lang.UnsupportedOperationException: This stream can't be wrote"
I've logged it as PDFJAVA-14920
3. It seems that BinaryFileStream(byte[] arr) doesn't work. I've logged it as PDFJAVA-14921
Regarding the issue "Is it possible to attach image that is dynamically created by servlet? " I think once the issue PDFJAVA-14921, you can export the image from servlet and use the BinaryFileStream object to add an image to PDF document.
Please spare us little time. Once we've some definite information regarding their resolution, we would be pleased to update you with the appropriate status.
Your patience and comprehension is greatly appreciated in this regard.
As per your requirements, you need to add an image from Memory into PDF document and I'm afraid currently BinaryFileStream object is not working correctly. I've tried number of scenarios but I'm afraid currently no workaround can fulfill your requirements.
Regarding the ETA of previously reported issues, we need to look into the details of these problems and before we've analyzed them, I'm afraid we might not be able to share the ETA information.
Please be patient. Your cooperation and comprehension is greatly appreciated in this regard.
Please try using the attached hotfix for Aspose.Pdf for Java 2.4.3 and as per my observation, its returning the correct value for Section.getStartingPageNumber(...). In case you still face any problem or you've any further query, please feel free to contact.
for (int i = 0; i < pdf1.getSections().size(); i++) { Section s = pdf1.getSections().getAt(i); System.out.println(s.getStartingPageNumber()); }
This prints two times “1”, but second section starts at page 7.
Also Pdf.version() from version 2.4.3 you provided returns “Aspose Pdf Java 2.4.0.0”. Is this ok?
And I have one more question. How can i set columns span in version 2.4. When I use method cell.setColumnSpan(2) I get exception "com.aspose.pdf.exception.AsposeBaseException: null at com.aspose.pdf.elements.Section.a(Unknown Source) at com.aspose.pdf.elements.Pdf.if(Unknown Source) at com.aspose.pdf.elements.Pdf.a(Unknown Source) at com.aspose.pdf.elements.Pdf.save(Unknown Source)
I've tested the scenario and I'm able to notice that Section.getStartingPageNumber() is returning incorrect page number information. I'm afraid we might not be able to correct this issue in older version of Aspose.Pdf for Java but we will try our level best to get it resolved in our new versions.
Regarding Col.setColumnSpan(...) issue, please try using the attached Aspose.Pdf for Java 2.4.3.1. As per my observation, setColumnSpan is working correctly in this version.
When using Pdf.version(..) method with this version, its returning the correct value.
In case you still face any problem or you've any further query, please feel free to contact.
Hello, Thanks for the fix. In this version setColumnSpan() works fine but the sign $p is not replaced with current page number.
Section.FirstPageNumber works fine in version 2.5.0 so I really hope that you will soon fix bugs with creating images from memory so we could start using it. It seems to me that this is a basic functionality so i hope you’ve put high priority to fix this bugs.
The issue regarding $p is a regression bug in Aspose.Pdf for Java 2.4.3.1 and it was earlier resolved in 2.4.2.13. Can you please try using the attached version of Aspose.Pdf for Java and in case you still face any further problem, please feel free to contact.
We will try our level best to get the issue regarding creation of images using Memory stream to be resolved, ASAP. Once we've some updates regarding its resolution, we would be pleased to update you with the status of correction.
I am pleased to inform you that PDFJAVA-14913 is resolved in our Aspose.Pdf for Java 2.7.0 release version. I have tested the following code snippet with this version and the PDF document is properly being generated. Please try using Aspose.Pdf for Java 2.7.0 (which can be downloaded from here) and see if it can resolve your problem.
[Java]
Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); aspose.pdf.Image image3 = new aspose.pdf.Image(sec1); sec1.getParagraphs().add(image3);
image3.getImageInfo().setFile("http://images.google.com.pk/intl/en_ALL/images/logos/images_logo_lg.gif"); image3.getImageInfo().setImageFileType(ImageFileType.Gif); image3.getImageInfo().setOpenType(ImageOpenType.Url); image3.getImageInfo().setTitle("jpeg image with url"); image3.setImageWidth(154); image3.setImageHeight(112);