PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 05, 2024 9:17 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Template Page Error
PostPosted: Wed Jan 26, 2011 9:01 pm 
Offline

Joined: Tue Jan 25, 2011 10:03 pm
Posts: 2
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);


Top
 Profile  
Reply with quote  
 Post subject: Re: Template Page Error
PostPosted: Thu Jan 27, 2011 9:11 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 77 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group