Receiving error PrintTicket XML is not well-formed. Root element is missing. when calling document.Print

0
danvonfeldt posted this 10 October 2017

I'm receiving error "PrintTicket XML is not well-formed. Root element is missing." when calling document.Print I have a reference to the ReachFramework as it looks like it has a dependency on that?

24 Posts
24 Points
6 Comments
Order By: Standard | Newest | Votes
0
jles posted this 10 October 2017

Hi Dan,

Could you tell us you are using Document.Print method and what parameters are you passing in?

Thanks, Jure Leskovec

118 Posts
244 Points
0
danvonfeldt posted this 10 October 2017

Document document = Document.Load(inputFilePath);
document.Print(printerName);

24 Posts
24 Points
1
jles posted this 11 October 2017

Dan,

We will do some tests in our environment. In the meantime, can you switch from XPS to GDI+ print engine:

EngineSettings.DefaultPrintEngine = PrintEngine.GdiPlus;

118 Posts
244 Points
0
danvonfeldt posted this 11 October 2017

That worked. Anything I should know about this engine vs XPS?

24 Posts
24 Points
1
jles posted this 11 October 2017

Docentric Toolkit has two engines implemented: XPS and GDI+. The vast majority of software uses GDI+ subsystem. This one is older than XPS. It seems that MS has discontinued development/support for XPS APIs and we also noticed cases where XPS is not stable for server-side printing, while GDI+ printing was.

We enabled XPS as the default printing engine because lit was a better printing Windows subsystem with benefits over the old GDI+. Still MS obviously abandoned it and we will switch the default to GDI+ in the next public release (v5.1).

GDI+ seems to be safe also for server side printing. We have been using this print engine for some time in our sister product Docentric AX for server-side printing and we have never had an issue reported.

GDI+ safe and you should stick with it. When you will install the new version you can remove that line that switches to the GDI+, since GDI+ will be the default option.

Regards, Jure

118 Posts
244 Points
0
danvonfeldt posted this 11 October 2017

Great, thanks for the response!

24 Posts
24 Points

Our 6361 members have posted 268 times in 79 discussions