I have a pdf file,Some chinese font lost when i convert it to jpg image use Aspose.PDF for Net 22.9.
the sample code:
void Main()
{
var doc = new Aspose.Pdf.Document(@"C:\Users\54390\Downloads\demo.pdf");
var pageCount = doc.Pages.Count;
for (var idx = 1; idx <= pageCount; idx++)
{
using (var ms = new MemoryStream())
{
var resolution = new Aspose.Pdf.Devices.Resolution(256);
Aspose.Pdf.Devices.ImageDevice imgDevice = new Aspose.Pdf.Devices.JpegDevice(resolution);
imgDevice.Process(doc.Pages[idx], ms);
using (var img = System.Drawing.Image.FromStream(ms))
{
img.Save(@"C:\Users\54390\Downloads\"+ idx +".jpg");
}
}
}
}
the compare result:
20221016193841.png (365.1 KB)
the demo file:
demo.pdf (91.1 KB)