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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - SaveToString() throws Exception
  FAQ FAQ  Forum Search   Register Register  Login Login

SaveToString() throws Exception

 Post Reply Post Reply
Author
Message
piehl View Drop Down
Beginner
Beginner
Avatar

Joined: 07 Oct 08
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote piehl Quote  Post ReplyReply Direct Link To This Post Topic: SaveToString() throws Exception
    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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store