www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - printed v0.0.3: a low-level API to generate self-contained PDF/SVG

reply Guillaume Piolat <spam smam.org> writes:
printed is a low-level API to generate self-contained PDF 1.4/SVG 
1.1 documents hopefully suitable for print.

Currently it does not provide any "layout" option, you are just 
provided a sort of 2D Canvas API which can then render to either 
SVG or PDF.

No line-breaking, paragraphs, ligature, vertical glyphs, or any 
type of layout are provided, they would have to be implemented on 
top of it.

The most saliant feature is that you are able to embed a 
TrueType/OpenType font inside the generated PDF, instead of being 
restricted to the default fonts of PDF.

It includes an OpenType parser, font matching algorithms and a 
FontRegistry which deals with "finding whatever font are 
installed".

http://code.dlang.org/packages/printed
Oct 01 2018
next sibling parent reply Dukc <ajieskola gmail.com> writes:
On Monday, 1 October 2018 at 09:34:34 UTC, Guillaume Piolat wrote:
 printed is a low-level API to generate self-contained PDF 
 1.4/SVG 1.1 documents hopefully suitable for print.
At work, I had to make a file converter which converts an obsolete CAD format to image files. It currently makes png and bmp files via dlib and svg files via dxml. This one will be useful if I need to extend it to pdf files. Thank you.
Oct 01 2018
parent reply Guillaume Piolat <spam smam.org> writes:
On Monday, 1 October 2018 at 10:19:12 UTC, Dukc wrote:
 On Monday, 1 October 2018 at 09:34:34 UTC, Guillaume Piolat 
 wrote:
 printed is a low-level API to generate self-contained PDF 
 1.4/SVG 1.1 documents hopefully suitable for print.
At work, I had to make a file converter which converts an obsolete CAD format to image files. It currently makes png and bmp files via dlib and svg files via dxml. This one will be useful if I need to extend it to pdf files. Thank you.
Mmmm you mean dlib has a software renderer?
Oct 01 2018
parent Dukc <ajieskola gmail.com> writes:
On Monday, 1 October 2018 at 10:44:53 UTC, Guillaume Piolat wrote:
 Mmmm you mean dlib has a software renderer?
Yes. https://github.com/gecko0307/dlib/blob/master/dlib/image/canvas.d Small and simple, but so far enough for my converter, as it pairs well with DLib's image file i/o.
Oct 01 2018
prev sibling next sibling parent Andrea Fontana <nospam example.com> writes:
On Monday, 1 October 2018 at 09:34:34 UTC, Guillaume Piolat wrote:
 printed is a low-level API to generate self-contained PDF 
 1.4/SVG 1.1 documents hopefully suitable for print.

 Currently it does not provide any "layout" option, you are just 
 provided a sort of 2D Canvas API which can then render to 
 either SVG or PDF.

 No line-breaking, paragraphs, ligature, vertical glyphs, or any 
 type of layout are provided, they would have to be implemented 
 on top of it.

 The most saliant feature is that you are able to embed a 
 TrueType/OpenType font inside the generated PDF, instead of 
 being restricted to the default fonts of PDF.

 It includes an OpenType parser, font matching algorithms and a 
 FontRegistry which deals with "finding whatever font are 
 installed".

 http://code.dlang.org/packages/printed
Nice!
Oct 02 2018
prev sibling next sibling parent reply Cristian Vasile <cristian512 yahoo.co.uk> writes:
On Monday, 1 October 2018 at 09:34:34 UTC, Guillaume Piolat wrote:
 printed is a low-level API to generate self-contained PDF 
 1.4/SVG 1.1 documents hopefully suitable for print.

 Currently it does not provide any "layout" option, you are just 
 provided a sort of 2D Canvas API which can then render to 
 either SVG or PDF.

 No line-breaking, paragraphs, ligature, vertical glyphs, or any 
 type of layout are provided, they would have to be implemented 
 on top of it.

 The most saliant feature is that you are able to embed a 
 TrueType/OpenType font inside the generated PDF, instead of 
 being restricted to the default fonts of PDF.

 It includes an OpenType parser, font matching algorithms and a 
 FontRegistry which deals with "finding whatever font are 
 installed".

 http://code.dlang.org/packages/printed
Hello, Pdf is good however please take a look at djvu format (http://djvu.org/) one of the authors is Yann LeCun.
Oct 02 2018
parent Guillaume Piolat <spam smam.org> writes:
On Tuesday, 2 October 2018 at 18:54:38 UTC, Cristian Vasile wrote:
 Hello,

 Pdf is good however please take a look at djvu format 
 (http://djvu.org/) one of the authors is Yann LeCun.
Hello, It seems this is primarily an image codec. printed'd goal is to make reproducible printable documents, and the format for this is PDF. PDF also includes JPEG2000 compression, and as you would guess it's not very much used.
Oct 03 2018
prev sibling parent Guillaume Piolat <spam smam.org> writes:
On Monday, 1 October 2018 at 09:34:34 UTC, Guillaume Piolat wrote:
 printed is a low-level API to generate self-contained PDF 
 1.4/SVG 1.1 documents hopefully suitable for print.
Hello, printed:htmlcolors is a sub-package for parsing HTML color (supporting a subset of CSS Color Module Level 4). safe pure. ------ example.d ---------- import printed.htmlcolors; parseHTMLColor("black"); // all HTML named colors parseHTMLColor("#fe85dc"); // hex colors parseHTMLColor("rgba(64, 255, 128, 0.24)"); // alpha parseHTMLColor("rgb(9e-1, 50%, 128)"); // percentage, floating-point parseHTMLColor("hsl(120deg, 25%, 75%)"); // hsv colors parseHTMLColor("gray(0.5)"); // gray colors parseHTMLColor(" rgb ( 245 , 112 , 74 ) "); // strips whitespace ---------------- Give a const(char)[], get a ubyte[4] back. http://printed.dpldocs.info/printed.htmlcolors.parseHTMLColor.html
Nov 02 2018