We have a document that contains an image and text with Arial-BoldMT, Helvetica Bold, MinionPro-Regular (Embedded Subset) and SourceSans3-Regular(Embedded).
We have installed these fonts in the Windows processing machine and also passed the path to the fonts to GroupDocs.
However, when the document is processed using GroupDocs to convert from PDF to image, the output image-based document created contains garbage values. We found it is because of the SourceSans3-Regular font.
We also tried using GroupDocs online to process but we are getting an exception when converting PDF to other document. When converting PDF to image we get the output file with the same garbage values. The exception is attached.
image.png (9.9 KB)
Can’t parse embedded font SourceSans3-Regular and no suitable system font found (FontNotFoundException)
Would like support regarding this issue.
@nabeel.ali
Hello,
Thank you for reaching out. Your request has been received and will be processed shortly.
If you have any additional details or files you would like to share, please feel free to attach them.
Best regards,
Technical Support Team
Hello @nabeel.ali ,
We are sorry to hear that you encountered this issue. To allow us to investigate your scenario on our side, could you please share the code sample you used for the conversion along with your test file? It would also be helpful if you could provide the fonts that you said were installed on the Windows processing machine.
Hello @evgen.efimov
Sure here is the code we use for conversion. Attached are the font files we installed and a screenshot of the file after processing.
private Dictionary<int, string> ConvertPDFToImage(List<int> pagesToConvert, float multiplier, int dpi, Dictionary<int, string> splittedPDFFilesPath,IPageInfo[] pageInfos)
{
Dictionary<int, string> jPGFilePaths = new Dictionary<int, string>();
foreach (int pageToConvert in pagesToConvert)
{
string PDFFilePath = null;
bool hasValue = splittedPDFFilesPath.TryGetValue(pageToConvert, out PDFFilePath);
if (hasValue)
{
// set path for converted image
string convertedImagePath = PDFFilePath.Replace(".pdf", $"Image-{pageToConvert}.jpg");
// adding this path to dictionary to be used later
jPGFilePaths.Add(pageToConvert, convertedImagePath);
using (var converter = new GroupDocs.Conversion.Converter(PDFFilePath))
{
// Set the convert options for JPG format
ImageConvertOptions options = new ImageConvertOptions { Format = GroupDocs.Conversion.FileTypes.ImageFileType.Jpg, HorizontalResolution = dpi, VerticalResolution = dpi };
// if multiplier is not 0,set height and width in image convert options
if (multiplier != 0)
{
options.Width = (int)((pageInfos[pageToConvert - 1].Width) * multiplier);
options.Height = (int)((pageInfos[pageToConvert - 1].Height) * multiplier);
}
// Convert to JPG format
converter.Convert(convertedImagePath, options);
}
}
}
return jPGFilePaths;
}
Source File (Sanitized):
test document - sanitized.pdf (47.4 KB)
Screenshot:
image.png (37.6 KB)
Font File:
fonts.7z (2.9 MB)
@nabeel.ali ,
Thank you for providing the necessary information. We were able to reproduce the issue on our side and have logged a corresponding ticket in our tracking system under the ID CONVERSIONNET-8084. Our development team will need additional time to investigate the root cause of the problem in more detail. As soon as I receive any updates from them, I will let you know.