PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jun 21, 2018 4:04 pm

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
PostPosted: Tue Jul 18, 2017 6:32 am 

Joined: Tue Jul 18, 2017 6:22 am
Posts: 1
I got the following exception :
To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. MigraDoc.DocumentObjectModel.Borders does not implement Add(System.Object).

I am using http://www.pdfsharp.net/wiki/Invoice-sample.ashx this page to create the same page as it is creating. But when I use
public Document CreateDocument()
  // Create a new MigraDoc document
  this.document = new Document();
  this.document.Info.Title = "A sample invoice";
  this.document.Info.Subject = "Demonstrates how to create an invoice.";
  this.document.Info.Author = "Stefan Lange";
  return this.document;

It return the specified error and when I did not return the document everything is good but it will not create pdf file. I am new to this , So please tell me how can I fix it?
Document is using MigraDoc.DocumentObjectModel .


Reply with quote  
PostPosted: Tue Jul 18, 2017 8:03 am 
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2817
Location: Cologne, Germany
Snehal wrote:
So please tell me how can I fix it?
Use MigraDoc as intended and it will work.
Use this forum as intended and we will be able to help: read the rules, use the Issue Submission Template, give is something to understand the problem and to replicate the exception.

It seems you feed the XML Serializer with objects that were not meant to be serialized. Show us what you do, otherwise we cannot detect the problem.

Thomas Hoevel
PDFsharp Team

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 10 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group