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.

Wed Mar 29, 2017 2:10 pm

Hello!

I am using Spire.PDF free version.
When i tried to print some PDF files they was printed without text. I found that this problem (#1) was due to the "arial" font installed in the operating system. When i installed new "arial" font that issue dissapeared for new files. But old files still not printing.

So i tryed to replace font in old files before printing. But now i have a new problem (#2): UsedFonts property does not works.

In the attachment you can see a test pdf file with error, that couses the problem #2 and "arial" font, that couses the problem #1.

Can you help me to solve this issues?

ah9peu
 
Posts: 5
Joined: Wed Aug 10, 2016 9:37 pm

Thu Mar 30, 2017 5:46 am

Dear ah9peu,

Thanks for your inquiry.
For the problem#1, I have noticed the issue that the text is missing after printing on the pdf file(test.pdf). And I have posted it to our Dev team, once there is any progress, we will inform you.
But for the problem#2, sorry that I didn't notice there is issue about UsedFonts property, it returns right font used in pdf file. What do you mean the property does not work ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Mar 30, 2017 6:45 am

Hello!

Betsy.jiang wrote:What do you mean the property does not work ?


I tryed this code from example:

PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"E:\test.pdf");
PdfUsedFont[] fonts = doc.UsedFonts; <- this code throws exception.

Screenshots of this error is in attachment.

Can you try to execute this exaple with my test pdf file (it was attached in my 1 message)?

ah9peu
 
Posts: 5
Joined: Wed Aug 10, 2016 9:37 pm

Thu Mar 30, 2017 7:14 am

Dear ah9peu,

Thanks for your information.
Please set the current culture as below, it will not throw the error.
Code: Select all
            CultureInfo cc = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(@"F:\testing\pdf form testing\original document\test10175-1.pdf");
            PdfUsedFont[] fonts = doc.UsedFonts;
            Thread.CurrentThread.CurrentCulture = cc;


Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Mar 30, 2017 8:48 am

Thanks a lot!

The propery "UsedFonts" works correct now.

ah9peu
 
Posts: 5
Joined: Wed Aug 10, 2016 9:37 pm

Tue Apr 11, 2017 8:13 am

Dear ah9peu,

Thanks for waiting.
Now the text missing issue has been fixed in Spire.PDF Pack(Hot Fix) Version:3.9.27. Welcome to test it.
Looking for your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Apr 13, 2017 7:19 am

Dear ah9peu,

Did you test the hotfix ? Has the text missing issue been resolved ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Apr 14, 2017 11:27 am

Betsy.jiang wrote:Dear ah9peu,

Did you test the hotfix ? Has the text missing issue been resolved ?

Thanks,
Betsy
E-iceblue support team


Hello, I shall test it today.
Thank you.

ah9peu
 
Posts: 5
Joined: Wed Aug 10, 2016 9:37 pm

Fri Apr 14, 2017 11:40 am

ah9peu wrote:
Betsy.jiang wrote:Dear ah9peu,

Did you test the hotfix ? Has the text missing issue been resolved ?

Thanks,
Betsy
E-iceblue support team


Hello, I shall test it today.
Thank you.


Now it works fine.
Thank you a lot!!

ah9peu
 
Posts: 5
Joined: Wed Aug 10, 2016 9:37 pm

Sat Apr 15, 2017 2:01 am

Hello,

Thanks for your feedback. Please contact us if you have any questions or needs.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Jun 12, 2017 5:29 am

I am facing the same issue with Usedfonts

Code: Select all
try
{
    CultureInfo cc = Thread.CurrentThread.CurrentCulture;
    Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
    Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
    doc.LoadFromFile(filePath);

    Spire.Pdf.Graphics.Fonts.PdfUsedFont[] fonts = doc.UsedFonts;
    Thread.CurrentThread.CurrentCulture = cc;
    Spire.Pdf.Graphics.PdfFont newfont = new Spire.Pdf.Graphics.PdfFont(Spire.Pdf.Graphics.PdfFontFamily.TimesRoman, 11f, Spire.Pdf.Graphics.PdfFontStyle.Italic | Spire.Pdf.Graphics.PdfFontStyle.Bold);
    foreach (Spire.Pdf.Graphics.Fonts.PdfUsedFont font in fonts)
    {
        font.Replace(newfont);
    }

    doc.SaveToFile("c:/FontReplaced" + Guid.NewGuid().ToString().Substring(0, 8) + ".pdf");
}
catch (Exception)
{

}



The below line throws an exception -
Code: Select all
Spire.Pdf.Graphics.Fonts.PdfUsedFont[] fonts = doc.UsedFonts;

hozefam
 
Posts: 3
Joined: Mon Jun 12, 2017 5:25 am

Mon Jun 12, 2017 5:50 am

Dear hozefam,

Thanks for your inquiry.
Did you use the latest Spire.PDF Pack(Hot Fix) Version:3.9.141 ? If the issue still happens with the version, please provide us with the input PDF file here or send it to us(support@e-iceblue.com) via email for investigation.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Jun 12, 2017 6:22 am

I am using the latest build of Sprire.pdf v3.9.141
I have attached a sample of the pdf file here which is throwing exception on usedfonts

hozefam
 
Posts: 3
Joined: Mon Jun 12, 2017 5:25 am

Mon Jun 12, 2017 6:56 am

Dear hozefam,

Thanks for the file.
I have noticed the issue and posted it to our Dev team. We will let you know once there is any progress.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Jun 15, 2017 5:28 am

Hi,

just wanted to check if there is any fix for the reported issue?

This is very critical for us as formatting document is not working as expected.

hozefam
 
Posts: 3
Joined: Mon Jun 12, 2017 5:25 am

Return to Spire.PDF