Failed when converting Chinese characters to pdf


#1

If we change “11111111111” as “口水画画测绘师111” with the following codes , there are two problems :
1,Some characters are lost.
2, The size of saved pdf file is from 3k to 100k:

// Create PdfFileStamp object
PdfFileStamp fileStamp = new PdfFileStamp();
Document pdfDocument1 = new Document();
// Insert a empty page in a PDF
pdfDocument1.Pages.Add();
// Open Document
fileStamp.BindPdf(pdfDocument1);
// Create stamp
Aspose.Pdf.Facades.Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.BindLogo(new FormattedText(“11111111111”, System.Drawing.Color.Blue, System.Drawing.Color.Gray, Aspose.Pdf.Facades.FontStyle.Helvetica, EncodingType.Winansi, true, 14));
stamp.SetOrigin(200, 200);

        stamp.IsBackground = true;
        // Add stamp to PDF file
        fileStamp.AddStamp(stamp);
        // Save updated PDF file
        fileStamp.Save( "test.pdf");
        // Close fileStamp
        fileStamp.Close();
        // ExEnd:AddTextStampAll
        pdfDocument1.Dispose();

New thread:Failed when converting Chinese characters to pdf
#2

@simon.zhao

Thanks for contacting support.

Would you kindly share the PDF document that you are using as input at your side. We will test the scenario in our environment and address it accordingly.


#3

the pdf file is new ,no input


#4

@lsl

Sorry for the confusion.

We tested the scenario in our environment while using Aspose.PDF for .NET 19.9 and your code snippet. We were unable to notice any issue. For your kind reference, an output PDF is attached. Test.pdf (112.9 KB)

Would you please make sure that all Microsoft Essential fonts are present/installed in your system. In case issue still persists, please share your environment details i.e. OS Name and Version, Application Type, etc. We will again test the scenario in our environment and address it accordingly.