# Let's work on pdf.cr

**URL:** <https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911>\
**Category:** Community\
**Created:** [September 4, 2022, 9:24am UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911 "2022-09-04T09:24:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![homodeluna](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/homodeluna/32/1755_2.png) [@homodeluna](https://forum.crystal-lang.org/u/homodeluna)\
**Post date:** [September 4, 2022, 9:24am UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/1 "2022-09-04T09:24:11Z")

</div>

Hello, I’m working on a fork of [pdf.cr](https://github.com/marceloboeira/pdf.cr). It’s dedicated to generate a pdf file in pure crystal(instead of just wrapping a foreign library). I am also interesting in building a similar lib,however,this lib is just at it’s very beginning. Therefore, I forked this repo and started to complete it(here is [my fork](https://github.com/HOMODELUNA/pdf.cr).

if this project can be finished, we can form a complete lib of pdf generator,therefore it can be used in other projects like file converters.

---

<div class="post-metadata">

**Author:** ![asterite](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/asterite/32/60_2.png) [@asterite](https://forum.crystal-lang.org/u/asterite)\
**Post date:** [September 4, 2022, 12:48pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/2 "2022-09-04T12:48:29Z")

</div>

Nice! What do you think about porting an existing pure Ruby library that generates PDF to Crystal instead?

---

<div class="post-metadata">

**Author:** ![homodeluna](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/homodeluna/32/1755_2.png) [@homodeluna](https://forum.crystal-lang.org/u/homodeluna)\
**Post date:** [September 4, 2022, 3:29pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/3 "2022-09-04T15:29:16Z")

</div>

As I know there is a ruby lib called [prawn](https://github.com/prawnpdf/prawn),and it is my major reference(though I sometimes get overwhelmed by it). Fow now I’m trying to implement the types in the pdf specification(ver 1.3).In order to implement the full prpject, I need fuurther improvements on my architect ability.

Do you have some preferred examples?

---

<div class="post-metadata">

**Author:** ![anon69898395](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon69898395](https://forum.crystal-lang.org/u/anon69898395)\
**Post date:** [September 4, 2022, 4:20pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/4 "2022-09-04T16:20:48Z")

</div>

That’s so exciting. I’ve been looking for a prawn equivalent for quite a while 👍

---

<div class="post-metadata">

**Author:** ![FriscoGPS](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/friscogps/32/770_2.png) [@FriscoGPS](https://forum.crystal-lang.org/u/FriscoGPS)\
**Post date:** [September 5, 2022, 3:55pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/5 "2022-09-05T15:55:57Z")

</div>

This is a great initiative. I used the [wkhtmltopdf-crystal](https://github.com/blocknotes/wkhtmltopdf-crystal) few years ago, but as you mention, it’s a wrapper foreign library. I’ll take a look at _pdf.cr_. I didn’t know it’s existance. Thanks for having us posted.

---

<div class="post-metadata">

**Author:** ![sardaukar](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/sardaukar/32/785_2.png) [@sardaukar](https://forum.crystal-lang.org/u/sardaukar)\
**Post date:** [September 6, 2022, 8:41am UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/6 "2022-09-06T08:41:40Z")

</div>

[This is a nice presentation on creating PDF files](https://speakerdeck.com/ange/lets-write-a-pdf-file)

---

<div class="post-metadata">

**Author:** ![threez](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/threez/32/1724_2.png) [@threez](https://forum.crystal-lang.org/u/threez)\
**Post date:** [September 9, 2022, 5:15pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/7 "2022-09-09T17:15:27Z")

</div>

I recently created [GitHub - threez/hpdf.cr: Create PDF documents in crystal using libhpdf / libharu](https://github.com/threez/hpdf.cr) it is not pure crystal but uses a c library. However it would allow you to build an abstraction on a higher level.

Generally I think we should less rewrite but more reuse. This way we can stand on the shoulder of giants. What is your opinion?

---

<div class="post-metadata">

**Author:** ![homodeluna](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/homodeluna/32/1755_2.png) [@homodeluna](https://forum.crystal-lang.org/u/homodeluna)\
**Post date:** [September 12, 2022, 4:54pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/8 "2022-09-12T16:54:17Z")

</div>

This is quite convenient and pragmatic,except one problem. Since I work mainly on windows, I wonder if there is a haru available on windows,and how should I link extern libs in different OSs.

what if we port a pre-compiled `haru` within the shard? or should Windows users install this lib on their own?

---

<div class="post-metadata">

**Author:** ![homodeluna](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/homodeluna/32/1755_2.png) [@homodeluna](https://forum.crystal-lang.org/u/homodeluna)\
**Post date:** [September 12, 2022, 5:17pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/9 "2022-09-12T17:17:25Z")

</div>

It seems to be a tutorial basic enough for me. is there other addresses available? there’s some problem for me getting these contents(contless timeout errors)

---

<div class="post-metadata">

**Author:** ![sardaukar](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/sardaukar/32/785_2.png) [@sardaukar](https://forum.crystal-lang.org/u/sardaukar)\
**Post date:** [September 12, 2022, 5:58pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/10 "2022-09-12T17:58:44Z")

</div>

There’s a download button on it, here’s the URL for the PDF of the slides [https://files.speakerdeck.com/presentations/6d1b3e5d3ae3403e80eb2515b7ac8e17/Let\_s\_write\_a\_PDF\_file.pdf](https://files.speakerdeck.com/presentations/6d1b3e5d3ae3403e80eb2515b7ac8e17/Let_s_write_a_PDF_file.pdf)

---

<div class="post-metadata">

**Author:** ![threez](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/threez/32/1724_2.png) [@threez](https://forum.crystal-lang.org/u/threez)\
**Post date:** [September 12, 2022, 7:33pm UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/11 "2022-09-12T19:33:10Z")

</div>

Good point regarding windows I think as soon as windows is supported we would need a concept in general in crystal. Or is there already a way to support it?

---

<div class="post-metadata">

**Author:** ![heimdalsgate](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/heimdalsgate/32/1835_2.png) [@heimdalsgate](https://forum.crystal-lang.org/u/heimdalsgate)\
**Post date:** [December 6, 2022, 11:08am UTC](https://forum.crystal-lang.org/t/lets-work-on-pdf-cr/4911/12 "2022-12-06T11:08:09Z")

</div>

Are there any recommended shards for reading PDFs and extracting text content for further analysis?
