The following code sample shows how to set the output image size limits when rendering the document.
// Create font sources.
// Add custom fonts folder to look for fonts recursively. (look into subfolders too).
FolderFontSourcefolderFontSource=newFolderFontSource("C:\\custom_fonts_folder",SearchOption.ALL_FOLDERS);// Add custom fonts folder to look for fonts only in this folder (wihout subfolders).
FolderFontSourceadditionalFontSource=newFolderFontSource("C:\\custom_additional_fonts_folder",SearchOption.TOP_FOLDER_ONLY)// Call SetFontSources method and supply font sources as arguments.
FontSettings.setFontSources(folderFontSource,additionalFontSource);try(Viewerviewer=newViewer("sample.psd")){JpgViewOptionsoptions=newJpgViewOptions("result.jpg");options.setDefaultFontName("Arial");viewer.view(options);}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.