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.

Fri Sep 15, 2017 4:15 pm

When I use "toPdf.UsePSCoversion = true" to my code and add PrivateFontPaths the fonts do NOT get embedded in the pdf file.
When I take the line out the fonts do get embedded and everything works fine..

Code: Select all
private static void SaveToStream(Document wordDocument, string reportName, Stream stream)
{
   var mStream = new MemoryStream();

   ToPdfParameterList toPdf = new ToPdfParameterList();
   //toPdf.UsePSCoversion = true; //added at suggestion of spire tech support to fix website gdi error.
   toPdf.EmbeddedFontNameList.Add("Letter Gothic");
   toPdf.PrivateFontPaths.Add(new PrivateFontPath("Letter Gothic", FontStyle.Regular, "LETGOT.TTF"));
   toPdf.PrivateFontPaths.Add(new PrivateFontPath("Letter Gothic", FontStyle.Bold, "LETGOTB.TTF"));
         
   toPdf.CreateWordBookmarks = true;
   toPdf.WordBookmarksTitle = reportName;
   toPdf.WordBookmarksColor = Color.Red;
   toPdf.WordBookmarksTextStyle = BookmarkTextStyle.Bold;
   wordDocument.BookmarkLayout += document_BookmarkLayout;
   wordDocument.SaveToStream(mStream, toPdf);

   //now opend it backup and enable the bookmarks to be visible in the browser.
   PdfDocument pdfdoc = new PdfDocument();
   pdfdoc.LoadFromStream(mStream);
   pdfdoc.ViewerPreferences.FitWindow = true;
   pdfdoc.ViewerPreferences.PageMode = PdfPageMode.UseOutlines;
   pdfdoc.SaveToStream(stream);

   stream.Flush();

   wordDocument.Close();
}


terrence@mactexas.com
 
Posts: 95
Joined: Tue May 19, 2015 8:09 pm

Mon Sep 18, 2017 4:01 am

Hello,

Sorry for late reply as weekend.
Sorry that using PS method doesn't support embedded fonts, bookmarks and hyperlinks on Azure at present. And I am afraid it is difficult to implement them in a short time due to its complexity. Anyway, if there is any good news in the future, we will let you know.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Mon Oct 23, 2017 8:19 am

Hello,

Thanks for waiting.
Now the embedded font issue has been fixed in Spire.Doc Pack(hot fix) Version:6.0.31.
Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Oct 27, 2017 6:47 am

Hello,

Now we publish Spire.Doc Pack(hot fix) Version:6.0.35 which supports also bookmarks and hyperlinks with PS method on Azure.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.PDF