Thread overview
Working with pdf
Jul 30, 2015
Kingsley
Jul 30, 2015
Andy Smith
Jul 30, 2015
Daniel Kozák
Jul 30, 2015
Kingsley
Jul 30, 2015
Adrian Matoga
Jul 30, 2015
JN
Jul 30, 2015
John Colvin
Jul 30, 2015
tcak
Jul 30, 2015
Ali Çehreli
July 30, 2015
Hi

Can anyone recommend any ways of pdf creation using D.

I am generating an HTML and JavaScript page but I would like it in pdf format as well.
July 30, 2015
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
> Hi
>
> Can anyone recommend any ways of pdf creation using D.
>
> I am generating an HTML and JavaScript page but I would like it in pdf format as well.

Hi Kingsley,

Python reportlab via PyD maybe? Obviously not as good as pure d solution ( or even a D linked to some C lib), but if matplotlib can be driven from D I'm sure reportlab can as well. I've played with it a bit it's relatively easy to pick up. Lots of examples you can hack^H^H^H^H 'tailor' to your needs :-)

Cheers,

A.



July 30, 2015
I use wkhtmltopdf:
http://wkhtmltopdf.org

On Thu, 30 Jul 2015 11:19:45 +0000
Kingsley via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> Hi
> 
> Can anyone recommend any ways of pdf creation using D.
> 
> I am generating an HTML and JavaScript page but I would like it in pdf format as well.
July 30, 2015
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
> Hi
>
> Can anyone recommend any ways of pdf creation using D.
>
> I am generating an HTML and JavaScript page but I would like it in pdf format as well.

Another indirect solution would be to generate PostScript (there's no existing lib in D that I know of, but I did it in plain C++ some time ago and it wasn't that unpleasant) and then convert it using something like ps2pdf.
July 30, 2015
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
> Hi
>
> Can anyone recommend any ways of pdf creation using D.
>
> I am generating an HTML and JavaScript page but I would like it in pdf format as well.

http://libharu.org/

could try this, haven't used it myself but Wt Toolkit (C++ web toolkit) uses it for PDF generation and it's written in C so should be trivial to embed in a D application.
July 30, 2015
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
> Hi
>
> Can anyone recommend any ways of pdf creation using D.
>
> I am generating an HTML and JavaScript page but I would like it in pdf format as well.

I don't know of any pdf handling libraries in D

Definitely check first to see if a command-line tool can do it well enough for you from the html. After that, it would be using another language e.g. via luaD, pyd or just linking to C.
July 30, 2015
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
> Hi
>
> Can anyone recommend any ways of pdf creation using D.
>
> I am generating an HTML and JavaScript page but I would like it in pdf format as well.

In 2013, I had started developing a module to create PDF files based on version 1.5 specification, but it had started being too complex to handle, and I needed to continue working. I don't know where it is now.

If you are on *unix systems though, you can use Cairo library for this I guess.
July 30, 2015
On Thursday, 30 July 2015 at 12:01:55 UTC, Daniel Kozák wrote:
> I use wkhtmltopdf:
> http://wkhtmltopdf.org
>
> On Thu, 30 Jul 2015 11:19:45 +0000
> Kingsley via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
>> Hi
>> 
>> Can anyone recommend any ways of pdf creation using D.
>> 
>> I am generating an HTML and JavaScript page but I would like it in pdf format as well.

This one I'm having the most success with thanks :)
July 30, 2015
On 07/30/2015 08:39 AM, tcak wrote:

> I had started developing a module to create PDF files based on
> version 1.5 specification, but it had started being too complex to
> handle

I looked at that option for my book, which is written in DDOC to generate HTML. Yes, PDF and layout issues in general are very complicated. :(

I ended up using Prince XML, which is known to be one of the best tools out there. It is free for personal use (check license before committing as it is expensive otherwise):

  http://www.princexml.com/

Ali