PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Oct 31, 2024 11:46 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Dec 04, 2008 5:28 pm 
Offline

Joined: Thu Dec 04, 2008 5:23 pm
Posts: 1
I have a .net class that renders a pdf form information stored in the db. Most of the time it works correctly. However, ocassionally I get the following error:

System.ArgumentException was caught
Message="An item with the same key has already been added."
Source="mscorlib"
StackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at MigraDoc.Rendering.FormattedDocument.MigraDoc.Rendering.IAreaProvider.StoreRenderInfos(ArrayList renderInfos)
at MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
at MigraDoc.Rendering.FormattedDocument.Format(XGraphics gfx)
at MigraDoc.Rendering.DocumentRenderer.PrepareDocument()
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareDocumentRenderer(Boolean prepareCompletely)
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareRenderPages()
at MigraDoc.Rendering.PdfDocumentRenderer.RenderDocument()
at F1Office.clsPrintWorkOrder.CreateWOPdf(String strCompanyName, String strWO, String strCreatedBy, String strPrimaryPhone, String strStartDate, String strLastEditedBy, String strCaller, String strDueDate, String strActualTime, String strAddress, String strAge, String strBillableTime, String strPriority, String strPriorityDate, String strBilled, String strSubject, String strDetails, DataGridView dgridActionsTaken) in C:\Data\Projects\F1 Office\F1OfficeV2\Classes\clsPrintWorkOrder.vb:line 124
InnerException:

Here's the relevant code

MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, "MigraDoc.mdddl")
Dim renderer As PdfDocumentRenderer = New PdfDocumentRenderer(True, PdfSharp.Pdf.PdfFontEmbedding.Always)
renderer.Document = document

The last line is the one that throws the exception

thanks,

Luis


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 39 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