PDF generation in D?

lobo via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 15 16:36:28 PST 2016


On Tuesday, 15 November 2016 at 15:23:29 UTC, Adrian Matoga wrote:
> On Tuesday, 15 November 2016 at 11:13:54 UTC, Jot wrote:
>> On Tuesday, 15 November 2016 at 09:39:09 UTC, Adrian Matoga 
>> wrote:
>>> On Friday, 11 November 2016 at 09:47:21 UTC, Robert burner 
>>> Schadek wrote:
>>>> I used text files and LaTeX in the past, it works with 
>>>> everything
>>>>
>>>> textfile -> process -> LaTeX -> pdf
>>>
>>> This.
>>>
>>> Another (a bit lower-level) option would be to produce a 
>>> PostScript file and pass it to (e)ps2pdf.
>>
>>
>> Then that begs the question about how to generate ps in D and 
>> just kicks the can down the road.
>
> PostScript is a programming language and PS files are plain 
> text files with programs written in it, so formatted file 
> output is your friend here.
>
> "Lower-level" means that you need to take care of the layout of 
> items on a page manually, using physical positions. It's quite 
> straightforward for simple vector graphics, but not so much for 
> multi-page text documents with figures and tables.

Cairo can render to a postscript surface and PDF surface[1]. 
Maybe there is something in gtkd that suits your needs[2]?

[1] https://www.cairographics.org/manual/cairo-PDF-Surfaces.html
[2] http://gtkd.org/


More information about the Digitalmars-d mailing list