PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Template Page Error
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1523
Page 1 of 1

Author:  FreeRollen [ Wed Jan 26, 2011 9:01 pm ]
Post subject:  Template Page Error

I am trying to open a PDF fiile and use one of it's pages as a template page for new PDF document call newDoc. I open the orginal PDF document a get the template page without a problem. I than add the template page to newDoc via page = newDoc.AddPage(inDoc.Pages[0]); This works fine.. I than get a gfx object for the page which is used to modify the newDoc page. However, As soon as i go to use the newly created gfx object to write a string to the newDoc i get a Assert Failure Error in PdfObjects Line75.
Any Help would be great!.
I am using PDFSharpClock project with VS2008...

Code:
// Get a fresh copy of the sample PDF file
string filename = "C:\\audiencefinder_countsummary.pdf";

// Reads document into memory for modification
PdfDocument inDoc = PdfReader.Open(filename, PdfDocumentOpenMode.Import);

PdfDocument newDoc = new PdfDocument();
this.time = newDoc.Info.CreationDate;
               newDoc.Info.Title = "Audience Finder";


// Adds the template PDF page to the newDoc PDF document
page = newDoc.AddPage(inDoc.Pages[0]);
gfx = XGraphics.FromPdfPage(page. XGraphicsPdfPageOptions.Append);

font_reg    = new XFont("Arial", 10, XFontStyle.Regular);
font_bold = new XFont("Arial", 10, XFontStyle.Bold);
brush_blk = new XSolidBrush(XColors.Black);
     
// Create a font
XFont     font  = new XFont("Arial", 10, XFontStyle.Bold);
XBrush    brush = new XSolidBrush(XColors.Black);
string test = "Jan 25, 2011 10:27AM";
gfx.DrawString(test, font, brush, 500, 123);

Author:  Thomas Hoevel [ Thu Jan 27, 2011 9:11 am ]
Post subject:  Re: Template Page Error

FreeRollen wrote:
i get a Assert Failure Error in PdfObjects Line75.

Asserts are just warnings.
It seems you can ignore this warning (or comment it out).

Assert doesn't show when using a Release build.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/