I have attached a sample pdf file. Using the below code, the output tiff is a completely blank page. I have also tried using aspose.pdf.Document and process() on a TiffDevice and a PngDevice and both output blank pages.
Hi Adam,
Is 11.2.0 in your maven repo? I’m only seeing 11.0.0. My project uses maven dependencies.
Hi Adam,
I’d like to reopen this issue. I cannot reproduce the problem using Aspose.Pdf 11.2.0 or 11.3.0 when running locally on Mac OS so I thought the problem was solved.
Hi Adam,
Hi,
Hi Adam,
We are sorry for the inconvenience. Apparently it seems its true type fonts related issues. Aspose.Pdf for Java Jar is not finding proper fonts on your Linux server… I have tested the PDF to TIFF conversion with your shared PDF document on Linux(CentOs) and unable to notice the issue. I have installed Microsoft fonts on my CentOS VM and these fonts are installed in system default font path i.e. /usr/share/fonts/msttcorefonts/.
Please note most of the PDF documents that we convert are created by people using Windows or Mac OS operating systems with fonts that are installed with Microsoft Windows or with Microsoft Office. So it is recommended to either install Microsoft fonts (mscorefonts) or copy true type fonts from your windows/Mac machine to your Linux server system default font folder path and try the conversion. Hopefully it will resolve the issue.
Furthermore if you want to use fonts form some of 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 the font folder path
String path = "/home/tilal/fonts/";
// Retrieve the current list of local font paths
java.util.List<String> list = com.aspose.pdf.Document.getLocalFontPaths();
// Add the custom font directory to the list
list.add(path);
// Update the document to use the updated list of font paths
com.aspose.pdf.Document.setLocalFontPaths(list);
// Additional processing can be done here
// ...
Best Regards,
I’m still having some trouble with this – what should the contents of my /usr/share/fonts folder look like? Does aspose recurse that directory if .ttf files are placed in sub-directories? Or would I need an explicit call to Document.addLocalFontPath() ?
Ok it turns out that the font file resources were getting modified and corrupted during the build, so some of the font files weren’t readable by Aspose. I fixed that and was able to get good results.
Hi Adam,