Hi,
I join JPEG image that do not appears in PDF file. Image is encapsulated in cell’s table.
It usually works except with this image.
I use Aspose PDF 3.1 jdk16
My code:
pdf = new Pdf();
Section seccion = pdf.getSections().add();
pdf.setAuthor(“I”);
pdf.setCreator(“I”);
pdf.setSubject(“my subject”));
pdf.setTitle(bundle.getString(“asuntoBono”));
seccion.getPageInfo().getMargin().setLeft(45.0f);
seccion.getPageInfo().getMargin().setRight(45.0f);
Table tablaDC = new Table();
tablaDC.setColumnCount(2);
tablaDC.setColumnWidths(“50% 50%”);
seccion.getParagraphs().add(tablaDC);
Row filaDC = tablaDC.getRows().add();
Cell celdaDC = filaDC.getCells().add();
celdaDC.setAlignment(AlignmentType.Left);
celdaDC.setVerticalAlignment(VerticalAlignmentType.Top);
celdaDC.setPadding(margen);
celdaDC.setNoBorder(true);
Image imagen = new Image();
imagen.getImageInfo().setImageFileType(ImageFileType.Jpeg);
f = new File(“logo.jpg”);
imagen.getImageInfo().setFile(f.getAbsolutePath());
imagen.setImageScale(0.75f);
celdaDC.getParagraphs().add(imagen);
…
awaiting your response,
cheers,
Hi Jerome.
Thanks for your query. It seems that your query is related to Aspose.Pdf product. I am moving this thread to Aspose.Pdf forum. My colleagues will reply you shortly.
Hello Jerome,
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFJAVA-33154. We will investigate this
issue in details and will keep you updated on the status of a correction.
Hi Jerome.
- try saving the file without a thumbnail preview
- try read it by ImageIO codec:
Pdf pdf = new Pdf();<o:p></o:p>
Section seccion = pdf.getSections().add();
pdf.setAuthor("I");
pdf.setCreator("I");
pdf.setSubject("my subject");
pdf.setTitle("asuntoBono");
seccion.getPageInfo().getMargin().setLeft(45.0f);
seccion.getPageInfo().getMargin().setRight(45.0f);
Table tablaDC = new Table();
tablaDC.setColumnCount(2);
tablaDC.setColumnWidths("50% 50%");
seccion.getParagraphs().add(tablaDC);
Row filaDC = tablaDC.getRows().add();
Cell celdaDC = filaDC.getCells().add();
celdaDC.setAlignment(aspose.pdf.AlignmentType.Left);
celdaDC.setVerticalAlignment(aspose.pdf.VerticalAlignmentType.Top);
//celdaDC.setPadding(.5f);
celdaDC.setNoBorder(true);
BufferedImage image = ImageIO.read(new File("D:/pdftest/Logo.jpg"));
Image imagen = new Image();
imagen.getImageInfo().setImageFileType(ImageFileType.Jpeg);
imagen.getImageInfo().setSystemImage(image);
imagen.setImageScale(0.75f);
celdaDC.getParagraphs().add(imagen);
pdf.save("D:/pdftest/ImageInPdf-Logo.pdf");
The issues you have found earlier (filed as PDFJAVA-33154) have been fixed in Aspose.Pdf for Java 3.3.0.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan