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 Sep 13, 2017 7:41 pm

I am running code that works fine on the desktop, but causes an error on my Auzre Website.

Code: Select all
A generic error occurred in GDI+.


Form Vars:
Stack Trace: at

System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) at

System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type) at

spr᪸.ᜀ(PageSetup A_0, ImageType A_1, MemoryStream A_2, Int32 A_3, GraphicsUnit A_4) at

spr᪸.ᜀ(PageSetup A_0, ImageType A_1, MemoryStream A_2, Int32 A_3) at

spr᪸.ᜒ() at

spr᪸.ᜁ(IDocument A_0) at

spr⊈.ᜀ(Document A_0) at

Spire.Doc.Document.ᜀ(Stream A_0, ToPdfParameterList A_1) at

MAC.Common.Utility.TMR.TMRPDFUtil.SaveToStream(Document wordDocument, String reportName, Stream stream) in E:\TeamCity\buildAgent\work\167110223c6d33dd\Common\MAC.Common.Utility\TMR\TMRPDFUtil.cs:line 349 at



Here is the method that contains the line 349 that causes the error.

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

         ToPdfParameterList toPdf = new ToPdfParameterList();
         toPdf.EmbeddedFontNameList.Add("Letter Gothic");
         toPdf.CreateWordBookmarks = true;
         toPdf.WordBookmarksTitle = reportName;
         toPdf.WordBookmarksColor = Color.Red;
         toPdf.WordBookmarksTextStyle = BookmarkTextStyle.Bold;
         wordDocument.BookmarkLayout += document_BookmarkLayout;
Line349: -->>         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

Thu Sep 14, 2017 3:33 am

Hello,

Thanks for your inquiry.
Please try to use PS method and the latest Spire.Doc Pack(hot fix) Version:6.0.8 to convert doc to pdf on Azure.
Code: Select all
ToPdfParameterList toPdf = new ToPdfParameterList();
toPdf.UsePSCoversion = true;

If there is still issue, please provide us your input document for testing.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Sep 15, 2017 3:47 pm

Thank you that fixed the problem on Azure.

Now all document print with the red warning despite having license code in my app.

Do the new 6.0 files require a different license?

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

Mon Sep 18, 2017 2:18 am

Hello,

Thanks for your feedback.
I got information from our sales team that your Spire.Doc license has expired, so please contact our sales team( sales@e-iceblue.com) to renew your Spire.Doc license subscription if you want to use the new version.
If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Jan 11, 2019 5:21 am

Is there any chance of having this hot fix on the FreeSpire.Doc library on nuget please?

diditester
 
Posts: 1
Joined: Fri Jan 11, 2019 5:01 am

Fri Jan 11, 2019 5:59 am

Hi diditester,

Thanks for your inquiry.
We could add the PS method in free Spire.Doc. Note the free version is not updated regularly, we cannot provide an estimated time at present.
Anyway, we will let you know as soon as there is any good news.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Jan 17, 2019 6:52 am

Hi,

Glad to inform you that the issue is solved in Free Spire.Doc for .NET Version:7.1.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Jan 18, 2019 6:57 am

Hi diditester,

Greetings from E-iceblue.
Did you use the new version? Has your issue been resolved?

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.PDF