Hi Robert,
Thanks for contacting support.
I have tested the scenario using Aspose.Pdf for Java 17.4.0 and I am unable to notice any issue when using Eclipse Juno project with JDK 1.8 running over Windows 7 (x64). Can you please share some further details regarding your working environment, so that we can again try replicating it in our environment. We are sorry for this inconvenience.
For your reference, I have also attached the output generated over my end.
[Java]
com.aspose.pdf.Document.addLocalFontPath(“c:/windows/fonts/”);<o:p></o:p>
try{
com.aspose.pdf.Document pdfDocument = new
com.aspose.pdf.Document();
com.aspose.pdf.Page policyPlacementPage = pdfDocument.getPages().add();
com.aspose.pdf.TextParagraph paragraph = new com.aspose.pdf.TextParagraph();
com.aspose.pdf.TextBuilder textBuilder = new
com.aspose.pdf.TextBuilder(policyPlacementPage);
textBuilder.appendParagraph(paragraph);
// byte[] picBytes = new
com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(tools.findPage("CoverPageBG").getString("pyFileSource"));
// java.io.InputStream HeaderImageIS = new
java.io.ByteArrayInputStream(picBytes);
com.aspose.pdf.Image Image1= new
com.aspose.pdf.Image();
Image1.setFixHeight(90);
Image1.setFile("C:\\pdftest\\ASPOSE_ISSUE\\ASPOSE_ISSUE\\Image
not working.png");//setImageStream(HeaderImageIS);
policyPlacementPage.getParagraphs().add(Image1);
com.aspose.pdf.TextFragment textFragment = new com.aspose.pdf.TextFragment("main
text");
textFragment.setPosition(new
com.aspose.pdf.Position(100, 600));
// append the text
fragment to the PDF page
textBuilder.appendText(textFragment);
// java.io.ByteArrayOutputStream outStream = new
java.io.ByteArrayOutputStream();
pdfDocument.save("C:\\pdftest\\ASPOSE_ISSUE\\ASPOSE_ISSUE\\Image
not working.pdf");
// byte[] xlBytes = outStream.toByteArray();
//
outStream.close();
// String
result=tools.sendFile(xlBytes,"ProgSum1.pdf",false,null,true);
}catch(Exception e){
// oLog.error("Exception
in POC "+e.toString());
}