<div dir="ltr"><div>I am doing a prettifying pass now:</div><div><ul><li>Adding function specs</li><li>Converting text specs to normal -spec specs</li><li>Adding named types where they make sense<br></li><li>Replacing tabs with spaces</li><li>Running Dialyzer on it, and fixing types so it makes sense<br></li><li>... that sort of thing. <br></li></ul>Can't promise when it will be finished, a day or two, or 3 weeks. You'll have a pull request when its done. Will be a MASSIVE changeset but no actual logic affected.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 25 Sep 2018 at 18:51, <<a href="mailto:lloyd@writersglen.com">lloyd@writersglen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Theepan,<br>
<br>
Other than display in my demo PDF, I haven't worked much with images. <br>
<br>
The issues you've run across seem serious. Getting at the root of the problems will likely involve a deep dive into both the PDF reference manuals and core ErlGuten source code. <br>
<br>
As I noted in my earlier email, ErlGuten source code is very challenging. It would benefit significantly from re-write, possibly refactoring in some cases and definitely systematic documentation of functions and parameters.<br>
<br>
I'm not confident that my skills are up to this. My take is that it would require some amount of community effort to put ErlGuten/erlpress_core on a solid, maintainable base. I would dearly love to see this happen.<br>
<br>
Is there a CS major or intern out there with time to take on the challenges?<br>
<br>
Joe showed us the way and I, for one, am deeply grateful. Given that PDF is a significant standard in the print media world, Erlang deserves to have a world-class library and suite of tools to generate PDF documents and decode them back into Erlang structures.<br>
<br>
This will take community effort.<br>
<br>
All the best,<br>
<br>
Lloyd<br>
<br>
<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: "Theepan" <<a href="mailto:vasdeveloper@gmail.com" target="_blank">vasdeveloper@gmail.com</a>><br>
Sent: Monday, September 24, 2018 7:27pm<br>
To: "Lloyd Prentice" <<a href="mailto:lloyd@writersglen.com" target="_blank">lloyd@writersglen.com</a>><br>
Cc: "Erlang Questions Mailing List" <<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>>, "Joe Armstrong" <<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>><br>
Subject: Re: [erlang-questions] ErlGuten<br>
<br>
Wanted to add to the issues the reasons --<br>
<br>
** When some JPEG image is embedded into the PDF, it turns out dark in the<br>
generated PDF file [Happens due to CYMK color profile.]<br>
** When some PNG file is embedded, it takes too long (unto 5 minutes) to<br>
generate the PDF file. Debugging shows that the delay is on defilter(Method<br>
, Line1, Line2, Offset, Width, Iter) of eg_pdf_image module.[Happens due to<br>
Alpha channel presence]<br>
<br>
<br>
<br>
On Tue, Sep 25, 2018 at 4:45 AM Theepan <<a href="mailto:vasdeveloper@gmail.com" target="_blank">vasdeveloper@gmail.com</a>> wrote:<br>
<br>
> Thanks Lloyd for your detailed explanation on what has been done, and your<br>
> vision for the library. However we are already using ErlGuten in one of our<br>
> production systems, and the issues is mainly with the images.<br>
><br>
> I will definitely keep an eye on the development of erlpress_core in the<br>
> future, as you seem enthusiastic about making it a lively library.<br>
><br>
> The issues we have are:<br>
><br>
> ** When some JPEG image is embedded into the PDF, it turns out dark in the<br>
> generated PDF file<br>
> ** When some PNG file is embedded, it takes too long (unto 5 minutes) to<br>
> generate the PDF file. Debugging shows that the delay is on defilter(<br>
> Method, Line1, Line2, Offset, Width, Iter) of eg_pdf_image module.<br>
><br>
> Did you come acrsoss this?<br>
><br>
> Best,<br>
> Theepan<br>
><br>
><br>
><br>
><br>
><br>
> On Tue, Sep 25, 2018 at 2:56 AM <<a href="mailto:lloyd@writersglen.com" target="_blank">lloyd@writersglen.com</a>> wrote:<br>
><br>
>> Hi Theepan,<br>
>><br>
>> 1. If you look at ErlGuten source, you'll see that function documentation<br>
>> is fairly minimal and many parameters have single character names with<br>
>> little to no documentation. This makes maintenance and revision very<br>
>> difficult. I consider the core ErlGuten modules diamonds-in-the-rough.<br>
>><br>
>> I also found the high-level page make-up functions provided by Hugh and<br>
>> Carl limited with respect to professional page make-up and, to me at least,<br>
>> a bit confusing.<br>
>><br>
>> But erlpress_core owes a deep debt and much gratitude to the ErlGuten<br>
>> lineage.<br>
>><br>
>> erlpress_core is based on Joe's font-handling, justification, and XML<br>
>> parsing code with few if any changes. But it provides map structures to<br>
>> represent nearly all of the PDF objects represented in eg_pdf_op.erl. These<br>
>> map structures incorporate many default parameters so generating PDF<br>
>> documents is syntactically simple and consistent without sacrificing<br>
>> expressive flexibility. You can easily customize display by instantiating<br>
>> map parameters with your own values.<br>
>><br>
>> You can see most of the PDF objects currently supported by erlpress_core,<br>
>> including boxed text, justification options, and various line and text<br>
>> objects, demonstrated in ep_show_n_tell.pdf and the source in<br>
>> ep_show_n_tell.erl.<br>
>><br>
>> If you look at the map definitions of the various PDF objects, you'll see<br>
>> how to customize display.<br>
>><br>
>> At some point if would be good to re-write the base Erlguten modules with<br>
>> more explicit function and parameter documentation, but I'm not up to that<br>
>> at this point. But, anyone looking for a challenge is free to jump in.<br>
>><br>
>> I'm currently working on tables and text flow across pages (think reports<br>
>> and book chapters). Hope to deliver these features plus much code polishing<br>
>> in the next release coming "real soon now."<br>
>><br>
>> High on my wish/to-do list are:<br>
>><br>
>> -- Easy-to_use page-grid design functions<br>
>> -- Imposition (printing multiple page impressions on a single sheet of<br>
>> paper stock)<br>
>> -- Articles and beads (think text jumping across  columns and pages)<br>
>> -- Easy-to-use and expressive page make-up functions<br>
>> -- Example templates for various print formats<br>
>> -- Markdown input<br>
>> -- Support of TTF and OTF fonts<br>
>><br>
>> Joe Armstrong expressed the following goal when he first announced<br>
>> ErlGuten:<br>
>><br>
>> "Better than TeX."<br>
>><br>
>> That's a tall order, yet to be realized. My hope is that erlpress will<br>
>> move the ball further down the field.<br>
>><br>
>> 2. I haven't done anything with image formats beyond what you'll find in<br>
>> eg_pdf_image.erl. I'd welcome work in that direction.<br>
>><br>
>> 3. erlpress_core is still at Version 0.01. It's just out. I'm working<br>
>> toward sufficient functionality and stability to support a web application<br>
>> that we have currently under development.<br>
>><br>
>> 4. I developed erlpress_core on Erlang/OTP 19. It does require support<br>
>> for maps.<br>
>><br>
>> I see the erlpress_core library as a valuable library for embedding PDF<br>
>> generation into Erlang applications and as the basis for many exciting<br>
>> Erlang-based print production tools.<br>
>><br>
>> So, Treepan, I appreciate your interest and would welcome your<br>
>> involvement in testing and feature development.<br>
>><br>
>> I would jump for joy if some Erlang guru were to step forward take on the<br>
>> TTF/OTF support issue. I've done some research and have a few ideas on how<br>
>> expanded font support might be accomplished, but have too little time over<br>
>> the next several months to dig into it.<br>
>><br>
>> Incidentally, in my previous post my iPad decided it was smarter than me<br>
>> and erroneously corrected my GitHUb <a href="http://address.it" rel="noreferrer" target="_blank">address.it</a> should be<br>
>> writersglen/erlPress_core.<br>
>><br>
>> My intention is to bag the camel case in my next release with luck in a<br>
>> week or two so it should look like writersglen/erlpress_core.<br>
>><br>
>> All the best,<br>
>><br>
>> Lloyd<br>
>><br>
>><br>
>> -----Original Message-----<br>
>> From: "Theepan" <<a href="mailto:vasdeveloper@gmail.com" target="_blank">vasdeveloper@gmail.com</a>><br>
>> Sent: Monday, September 24, 2018 3:59pm<br>
>> To: <a href="mailto:lloyd@writersglen.com" target="_blank">lloyd@writersglen.com</a><br>
>> Cc: "Erlang Questions Mailing List" <<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>>, "Joe<br>
>> Armstrong" <<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>><br>
>> Subject: Re: [erlang-questions] ErlGuten<br>
>><br>
>> Hi Lloyd,<br>
>><br>
>> Thank you for your response. I have some quick clarifications --<br>
>><br>
>> * What are the major improvements made on the source ErlGuten? Did you<br>
>> improve support to different image formats? Any critical bugs fixed?<br>
>> * Is erlPress_core used in commercial applications, specifically of high<br>
>> throughput types?<br>
>> * What is the minimum erlang/OTP version required?<br>
>><br>
>> Best,<br>
>> Theepan<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Mon, Sep 24, 2018 at 6:36 AM Lloyd R. Prentice <<a href="mailto:lloyd@writersglen.com" target="_blank">lloyd@writersglen.com</a>><br>
>> wrote:<br>
>><br>
>> > Hi Thepan,<br>
>> ><br>
>> > I’ve undertaken a major revision of ErlGuten called erlPress_core—<br>
>> > announced it on Erlang questions several weeks ago.  It’s available from<br>
>> > GitHub as Writersglen/erlPress_core. I think you’ll find it much more<br>
>> > accessible than the ErlGutens.<br>
>> ><br>
>> > I’ve since been polishing up the code and adding a few new features.<br>
>> After<br>
>> > the launch I learned that camel case is not conventional usage when it<br>
>> > comes to the names of Erlang applications and libraries. So I plan to<br>
>> > release the updated version as erlpress_core. With smooth sailing I<br>
>> hope to<br>
>> > release sometime this week or next.<br>
>> ><br>
>> > All the best,<br>
>> ><br>
>> > Lloyd<br>
>> ><br>
>> > Sent from my iPad<br>
>> ><br>
>> > On Sep 23, 2018, at 8:30 PM, Theepan <<a href="mailto:vasdeveloper@gmail.com" target="_blank">vasdeveloper@gmail.com</a>> wrote:<br>
>> ><br>
>> ><br>
>> > Hi Team,<br>
>> ><br>
>> > I see many forks of ErlGuten. Which one is the latest, most stable and<br>
>> > widely used?<br>
>> ><br>
>> > <a href="https://github.com/richcarl/erlguten" rel="noreferrer" target="_blank">https://github.com/richcarl/erlguten</a><br>
>> > <a href="https://github.com/CarlWright/NGerlguten" rel="noreferrer" target="_blank">https://github.com/CarlWright/NGerlguten</a><br>
>> > <a href="https://github.com/hwatkins/erlguten/commits/master" rel="noreferrer" target="_blank">https://github.com/hwatkins/erlguten/commits/master</a><br>
>> ><br>
>> > Best,<br>
>> > Theepan<br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > erlang-questions mailing list<br>
>> > <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
>> > <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>