Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Oct 12, 2015 11:16 am

Hello, I have a problem with convert doc to pdf. My test document contains text wrote private font. How can I Include my font to the document?

Now i'm using method: public void SaveToStream(Stream stream, ToPdfParameterList paramList) where

var paramList = new ToPdfParameterList();
paramList.EmbeddedFontNameList.Add("MyFont"); // my font has been installed on my test server

of course, pdf opened on my test server, shows proper fonts, but on other clients machines font is invalid (eg. pc without installed font).

gro26
 
Posts: 4
Joined: Mon Oct 12, 2015 11:02 am

Tue Oct 13, 2015 2:11 am

Hi,

Thanks for your inquiry.
Please try the following solution to embed your font without installing it in your computer.
Code: Select all
 Document document = new Document();
            document.LoadFromFile("original.docx");
            ToPdfParameterList parms = new ToPdfParameterList()
            {
                PrivateFontPaths = new List<PrivateFontPath>() { new PrivateFontPath("AeridanishScript", "..\\..\\AeridanishScript.ttf") }
            };
            document.SaveToFile("result.pdf", parms);


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Tue Oct 13, 2015 8:36 am

Hi,
i'm afraid version 5.0.12.3040 doesn't contain PrivateFontPaths property ...

Code: Select all

namespace Spire.Doc
{
    public class ToPdfParameterList
    {
        public ToPdfParameterList();

        // Summary:
        //     Gets/Sets The tblLayout element specifies that the table must use the auto
        //     layout algorithe.
        public bool AutoFitTableLayout { get; set; }
        //
        // Summary:
        //     Gets/Sets Embedded into PDF document font name.
        public List<string> EmbeddedFontNameList { get; set; }
        //
        // Summary:
        //     Gets/Sets To Pdf TextBox HeightType.The default is "Exactly".
        public bool IsAtLast { get; set; }
        //
        // Summary:
        //     Gets/Sets hidden text is converted.
        public bool IsHidden { get; set; }
    }
}


gro26
 
Posts: 4
Joined: Mon Oct 12, 2015 11:02 am

Tue Oct 13, 2015 8:58 am

Hi,

Please use the latest version(Spire.Doc Pack(hot fix) Version:5.5.112).
Downloading link is http://www.e-iceblue.com/Download/downl ... t-now.html.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Tue Oct 13, 2015 9:17 am

Hi again,
I've tried my solution (with using EmbeddedFontNameList) on the verion 5.5.112 and works fine, document contains proper fonts. So can I get fix for my version of library or update to new one? Of course I've paid for 5.0.12.3040.

Thanks.

gro26
 
Posts: 4
Joined: Mon Oct 12, 2015 11:02 am

Wed Oct 14, 2015 1:09 am

Hi,

Sorry that we didn't find your license purchase information by your registered mail. Please provide us your purchased license information.

Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Wed Oct 14, 2015 7:27 am

Hi,
I'm eployee of Pentegy S.A.. A part of Spire.Doc Pro Edition license file below:

<Type>Runtime</Type>
<Username>Pentegy S.A.</Username>
<Email>[email protected]</Email>
<Organization>Pentegy S.A.</Organization>

<Name>e-iceblue</Name>
<Email>[email protected]</Email>
<Url>http://www.e-iceblue.com</Url>

gro26
 
Posts: 4
Joined: Mon Oct 12, 2015 11:02 am

Wed Oct 14, 2015 7:46 am

Hi,

Thanks for providing.
Your license file is invalid for the verion 5.5.112. Please renew the license for Spire.Doc Pro Edition.
If you have any problems regarding purchasing, please send them to [email protected].

Have a nice day.
Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc