elixir-pdf icon indicating copy to clipboard operation
elixir-pdf copied to clipboard

Why GenServer to hold the document?

Open alappe opened this issue 3 years ago • 7 comments

Dear Andrew,

thanks for starting this package – much appreciated. While converting an old pdf over to your library, I wondered why the document is hold inside a GenServer? I read through it and even converted a local version to return the %Document{} instead of a pid(), all working fine.

I do see a benefit for holding fonts and objects though.

Regards Andreas

alappe avatar Mar 09 '21 15:03 alappe

@alappe I know this was some time ago, but would you be willing to share your version?

Hermanverschooten avatar Jan 19 '23 09:01 Hermanverschooten

@Hermanverschooten sure, but it will take until next week due to holiday.

alappe avatar Jan 19 '23 11:01 alappe

@Hermanverschooten Sorry, I forgot it's on github anyway:

https://github.com/zimmer7/elixir-pdf/tree/document_without_process

This is the branch I'm using in one project.

alappe avatar Jan 24 '23 15:01 alappe

@alappe Thanks! Small question though, why did you change the name to PDF?

Hermanverschooten avatar Jan 25 '23 10:01 Hermanverschooten

I can't recall, probably because it worked and that's the usual writing of the format. This complicates merging – sorry for that!

Looking into it, I wasn't really that wrong: https://hexdocs.pm/elixir/1.12/naming-conventions.html#casing

alappe avatar Jan 25 '23 13:01 alappe

Wasn't complaining, just wondering.

Hermanverschooten avatar Jan 25 '23 13:01 Hermanverschooten

Alright :)

alappe avatar Jan 25 '23 13:01 alappe