Hi Team,
Image created by using Aspose Libraries on Unix is completely blank while on Windows is working fine
Hi Naveen,
Thanks for your inquriy. I have tested the scenario over Linux(CentOs) using following code with Aspose.Pdf for Java 11.3.0 and unable to notice the issue. Please share your sample code here, we will look into it and will guide you accordingly.
PdfConverter converter = new PdfConverter();
converter.bindPdf("samplePDFFile.pdf");
String prefix = "thumbnail";
String suffix = ".jpg";
int imgCount = 1;
converter.setStartPage(1);
converter.setEndPage(1);
while (converter.hasNextImage()) {
String outputFileName = prefix + imgCount + suffix;
converter.getNextImage(outputFileName, com.aspose.pdf.ImageType.getJpeg(), 100, 100, 100);
imgCount++;
}
We are sorry for the inconvenience caused.
Best Regards,
Hi Tilal,
Hi Naveen,
In addition to above reply. Please note on non-Windows OSs Aspose.Pdf for Java looks fonts in system default font path. For Example in case of CentOS it looks fonts in /usr/share/fonts/. I had installed Microsoft fonts on the CentOS and these fonts are installed in system default font path i.e. /usr/share/fonts/msttcorefonts/.
It seems Aspose.Pdf for Java is unable to find fonts on your system. Can you please install Microsoft fonts on your system or copy fonts from your windows OS and paste to your system default font path, and try the conversion again? Hopefully it will resolve the issue.
Furthermore if you want to use fonts form some your custom folder then you need to add that folder path into LocalFontPath as following. You can use following methods to get system folder of fonts or set font path to font folders.
- Document.getLocalFontPath () - shows the system folder in which project will look for fonts.
- Document.setLocalFontPath (String) - Setting font path to custom folder
// Set font folder path
String path = "/home/tilal/fonts/";
// Adding a single font directory
// com.aspose.pdf.Document.addLocalFontPath(path);
// setting the user list for standard font directories
java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();
list.add(path);
com.aspose.pdf.Document.setLocalFontPaths(list);
We are sorry for the inconvenience caused.
Best Regards,