Is there such a thing as printer markup language

I like to print a document. The contents of the document are tables and text with different colors. Is there a lightwight printer file that can be used as a template?

PS, PDF, DOC files, in my opinion, are hard to parse. There may be some XML or YAML file format that supports:

  • Simple creation (possibly with a WYSIWYG editor)
  • Analysis and manipulation of library support
  • Easy sending to a printer (possibly with library support)

Or do I need to do this in the usual way and draw in the CDC?

+4
source share
7 answers

I noticed that you are using MFC (so, Windows). In this case, the answer will be qualified yes. In recent versions of Windows, Microsoft offers the XPS Document API , which allows you to create and process a PDF-like document using XML, which can then be printed using the XPS print API.

(For earlier versions of Windows that do not support this API, you can try to deal with the XPS file directly, but it is probably much more complicated than using CDC . Even with the API you will work at a fairly low level.)

End users can create XPS documents using the XPS print driver, which is available for free from Microsoft (and bundled with some MS products - they probably already have it in their system).

+2
source

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

However, you can use XSL-FO to create documents that can then be passed to the printer driver using library support.

+2
source

I think something like TeX or LaTeX (or even troff or groff) can satisfy your needs. Google them and see.

There are also libraries for rendering documents for printing from an HTML source. Take a look at http://libharu.sourceforge.net/ , for example. This displays the finished .PDF printer

+1
source

But I think Post Script is a really good choice for this. This is actually a very simple language and should be very easy to parse because it is stack oriented. Then - most printers support it, and even if you don’t have support, you can use GhostScript to convert for many different formats (see GS as “virtual PS supporting printer”). Finally, there are many books and manuals for the language.

About parsing - you can define new variables and functions in PS. So maybe your problem can be solved (almost) completely using PS.

+1
source

HTML + CSS can be printed - correctly. CSS was designed to support this with the media attribute, to indicate that your CSS is for the printer layout and not for the screen layout. There are tools available for rendering this for printing, such as PRINCE (free + commercial versions).

+1
source

I think postscript is the markup language used by printers. I read this somewhere, so correct me if the postscript is now out of date.

http://en.wikipedia.org/wiki/PostScript

0
source

For a more powerful package, you can use Latex. It will provide options for creating templates where you can simply copy text.

In a more user-friendly graphic document, MS-Word and other word processors have templates. The problem is that they do not have a common standard or markup.

You can also use HTML to render material in general markup, but it will not be very convenient for printing. A.

0
source

All Articles