0

I have a program that accepts parameter and generate XPS file. However I've found that SOME file cannot be printed out with whether Windows XPS Viewer or Windows API to print it out.

When printing with XPS Viewer, it will prompt an error with "A printing error has occurred", "The XPS Viewer cannot print all pages of this document".

While printing with Windows Api Startxpsprintjob, it did returned a print job id but not print out.

For both the method above, it will produce the following sequence in windows print operation log: Seems the job is deleted before print

As it only happens for some combination, I suspect that maybe it's related to XPS embedded font, however I can view all fonts correctly in the XPS viewer.

I have no idea on what can I do next, any help will be appreciate, thanks!

Community
  • 1
  • 1
nathan1658
  • 175
  • 1
  • 14

1 Answers1

0

It's about XPS file contents and the way how Windows handles it. Some hints can be picked up here https://stackoverflow.com/a/6678902

You could try to print page by page (or even selection) and try to find out which contents cannot be printed.

What I experienced, the case when word document had been converted into XPS file, insertion of image with text made the problem, and inserted text box was the solution.

So, it can be anything. Good luck! :-)

  • I eventually fixed the issue. It's because the PC which generate XPS has a older version of the font and embedded it as ODTTF inside the XPS file. A newer version of windows tries to print that file and find a mismatch of that font file, and it fails to print it. The strange part is that as the font is already embedded in the XPS file, the PC who tries to print that file still tries to do a substitution from it's font library. Consulted official MS support and seems this behavior has been fixed after windows 7 – nathan1658 Jun 27 '19 at 07:34