Hello,
I am new to MigraDoc & PDFSharp but it is very simple to use. Creating documents is really easy.
Today I have tried to print a generated document and I always get an error message while using DocumentFromFile:
My System is in German and says:
"Symbol '\\document' erwartet, '%' vorgefunden."
In English it should be something like "Symbol '\\document' expected, '%' found".
I also have tried to open regular PDF that are nor generated by MigraDoc.
This is the code I am using for printing:
Code:
try
{
Document document = MigraDoc.DocumentObjectModel.IO.DdlReader.DocumentFromFile(file);
string ddl = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(document);
MigraDoc.Rendering.DocumentRenderer doc = new DocumentRenderer(document);
MigraDoc.Rendering.Printing.MigraDocPrintDocument print = new MigraDoc.Rendering.Printing.MigraDocPrintDocument();
print.PrinterSettings.PrinterName = "Dell MFP Laser 3115cn PS";
print.Renderer = doc;
print.Print();
}
catch (Exception e)
{
String msg = e.Message;
}
The error message appears already at the first line "Document document..."
I am using the actual assemblies. What I am doing wrong?
Any hints are appreciated.
Thanks a lot in advance.
Kind regards,
Bjoern