Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
SaveToString() throws Exception |
Post Reply ![]() |
Author | |
piehl ![]() Beginner ![]() ![]() Joined: 07 Oct 08 Location: Germany Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 24 Nov 08 at 10:03AM |
Hi Forum, hi Ingo,
still working with C# .NET Framework 3.5 but upgrading to iSEDQuickPDF.dll v6.02 Beta there is an other curious behaviour I found: My Unit Test run, using iSEDQuickPDF statics to create several documents, saving to file and saving to string. The method SaveToString() throws an "AccessViolationException", shown below -> // DOC 1.1 -> File int docId = QuickPdfNativeMethods.NewDocument(); QuickPdfNativeMethods.SetMeasurementUnits(MeasurementUnit.Millimeters); QuickPdfNativeMethods.SetOrigin(Origin.TopLeft); QuickPdfNativeMethods.SetPageSize("A4 Landscape"); int fontId = QuickPdfNativeMethods.AddTrueTypeFont("Arial", 0); //int fontId = QuickPdfNativeMethods.AddTrueTypeFont("Arial", 1); //int fontId = QuickPdfNativeMethods.AddStandardFont(StandardFont.Helvetica); QuickPdfNativeMethods.SelectFont(fontId); QuickPdfNativeMethods.SetTextSize(12); QuickPdfNativeMethods.DrawText(10, 10, "Hello World:"); } QuickPdfNativeMethods.SaveToFile(@"C:\Buffer\PdfTest1.pdf"); QuickPdfNativeMethods.RemoveDocument(docId); // DOC 1.2 -> String docId = QuickPdfNativeMethods.NewDocument(); QuickPdfNativeMethods.SetMeasurementUnits(MeasurementUnit.Millimeters); QuickPdfNativeMethods.SetOrigin(Origin.TopLeft); QuickPdfNativeMethods.SetPageSize("A4 Landscape"); fontId = QuickPdfNativeMethods.AddTrueTypeFont("Arial", 0); // fontId = QuickPdfNativeMethods.AddTrueTypeFont("Arial", 1); // fontId = QuickPdfNativeMethods.AddStandardFont(StandardFont.Helvetica); QuickPdfNativeMethods.SelectFont(fontId); QuickPdfNativeMethods.SetTextSize(12); QuickPdfNativeMethods.DrawText(10, 10, "Hello World:"); string sPdf = QuickPdfNativeMethods.SaveToString(); // throw Exception QuickPdfNativeMethods.RemoveDocument(docId); // DOC 2.1 -> Datei docId = QuickPdfNativeMethods.NewDocument(); QuickPdfNativeMethods.SetMeasurementUnits(MeasurementUnit.Millimeters); QuickPdfNativeMethods.SetOrigin(Origin.TopLeft); QuickPdfNativeMethods.SetPageSize("A4 Landscape"); fontId = QuickPdfNativeMethods.AddTrueTypeFont("Arial", 0); // fontId = QuickPdfNativeMethods.AddTrueTypeFont("Arial", 1); // fontId = QuickPdfNativeMethods.AddStandardFont(StandardFont.Helvetica); QuickPdfNativeMethods.SelectFont(fontId); QuickPdfNativeMethods.SetTextSize(12); QuickPdfNativeMethods.DrawText(10, 10, "Hello World:"); sPdf = QuickPdfNativeMethods.SaveToString(); // throw Exception QuickPdfNativeMethods.RemoveDocument(docId); whenever -> a TrueType Font was added, but not embedded. (AddTrueTypeFont(fontName, 0)) Exception is throws after min. 2 invokes of SaveToString() Using -> an embeded TTF. (AddTrueTypeFont(fontName, 1)) Exception is throws after min. 8 invokes of SaveToString() Using -> a standard font, the SaveToString() still works fine! Seems to be a bug? Any good advices or workarounds except using standard fonts??? Best regards, Torsten |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store