Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there such a thing like a Printer-Markup-Language

I like to print a document. The content of the document are tables and text with different colors. Does a lightwight printer-file-format exist, which can be used like a template?

PS, PDF, DOC files in my opinion are to heavy to parse. May there exist some XML or YAML file format which supports:

  1. Easy creation (maybe with a WYSIWYG-Editor)
  2. Parsing and manipulation with Library-Support
  3. Easy sending to the printer (maybe with Library-Support)

Or do I have to do it the usual way and paint within a CDC?

like image 541
Christian Ammer Avatar asked Oct 14 '10 08:10

Christian Ammer


2 Answers

I noticed you’re using MFC (so, Windows). In that case the answer is a qualified yes. In recent versions of Windows, Microsoft offers the XPS Document API which lets you create and manipulate a PDF-like document using XML, which can then be printed using the XPS Print API.

(For earlier versions of Windows that don’t support this API, you could try to deal with the XPS file format directly, but that is probably a lot harder than using CDC. Even with the API you will be working at a fairly low level.)

End users can generate XPS documents using the XPS print driver that is available for free from Microsoft (and bundled with certain MS products—they probably already have it on their system).

like image 111
Nate Avatar answered Nov 02 '22 22:11

Nate


There is no universal language that is supported across all (or even many) printers. While PCL and PS are the most used, there are also printers which only work with specific printer drivers because they only support a proprietary data format (often pre-rendered on the client).

However, you could use XSL-FO to create documents which can then be rendered to a printer driver using library support.

like image 31
Lucero Avatar answered Nov 03 '22 00:11

Lucero