Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sat Dec 04, 2021 10:07 am

Code: Select all
 using (var stream = new MemoryStream())
            {
                Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(htmlString, stream, false, 10 * 1000, new SizeF(550, 750), new PdfMargins(10, 20), LoadHtmlType.SourceCode);
                using (var pdfDoc = new PdfDocument(stream))
                {
                    // This check is to remove empty pdf pages, if any from Spire.PDF.
                    for (int i = 0; i < pdfDoc.Pages.Count; i++)
                    {
                        var pdfPage = pdfDoc.Pages[i];
                        var pdfText = pdfPage.ExtractText().Trim();
                        var images = pdfPage.ExtractImages();
                        if ((string.IsNullOrEmpty(pdfText) || pdfText.Length == 0) &&
                            (images == null || images.Length == 0))
                        {
                            pdfDoc.Pages.Remove(pdfPage);
                        }
                    }
                    pdfDoc.SaveToFile(filepath, FileFormat.PDF);
}


htmlTemplate

Code: Select all
<!DOCTYPE html>
<html lang="zh" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
   
</head>
<body>
    <div class="container">
        <div class="row mt-3">
            <div class="col-7">
                <div>
            日语和韩语中使用的汉字仍然很多。 一般来说,日本人的文化程度是由他所理解的汉字数量决定的。 虽然现在韩国人大多用韩文书写,但人们发现,有些意思仅仅用韩文是无法表达清楚的,所以人们需要使用汉字作为带括号的注释。 1446年以前,朝鲜人只使用汉字。
            <div>
            在日语中,从汉语中借用的字符称为汉字。 汉字既可用于书写日语母语单词,也可用于书写汉语借词。 日语写作混合使用汉字和两种假名系统。 汉字主要用于表示单词的意思,而平假名和片假名是表示日语单词发音的音节。 这两种书写系统在书写日语时都经常使用。
            </div>
            </div>
            </div>
     </div>       
   </div>
</body>
</html>


OS: Win 2012 R2,
Region: US
Language : English

Default System fonts intalled
Simhei
SimKaiTi
SimSun
SimSun-ExtB

URGENT: Please let me know why I'm still seeing ??????? in my PDF document.
What is the Font Spire is using and What I supposed to use in my html or system.

NSK_User000
 
Posts: 2
Joined: Wed Dec 01, 2021 7:11 am

Sun Dec 05, 2021 2:38 pm

Hello Team,
Any updates on this so far ? We are in urgent need to fix this issue.
Please help in closing this issue ASAP?

NSK_User000
 
Posts: 2
Joined: Wed Dec 01, 2021 7:11 am

Mon Dec 06, 2021 6:03 am

Hello,

Thanks for your post and email feedback.
Glad to hear that the newer Plugin package which we have updated under the “windows-x64.zip" download link could work for you.
If there is anything else we can do for you in the future, just feel free to contact us!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1534
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron