I have a PDF with two digital signatures in it, and now I code it to generate an image.
- Now, I run the following code under Windows, and the resulting image will show the signature normally
- When I run the following code under Linux, the resulting image does not show the digital signature(The Linux environment contains all Windows fonts)
Code:
string pdfPath = “test.pdf”;
string outputImagePath = “test.jpg”;
using (var fileStream = new FileStream(pdfPath, FileMode.Open, FileAccess.Read, FileShare.Read))
using (Document doc = new Document(fileStream))
{
var page = doc.Pages[0];
using (FileStream imageStream = new FileStream(outputImagePath, FileMode.Create))
{
Resolution resolution = new Resolution(100);
JpegDevice jpegDevice = new JpegDevice(resolution, 30);
jpegDevice.Process(page, imageStream);
}
}
PDF
认购.pdf (142.2 KB)
The above code generates a picture under Windows
认购.jpg (14.2 KB)
The above code generates a picture under Linux
认购.jpg (9.5 KB)