<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="345632" data-post-id="345632">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ErikNaslund" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ErikNaslund/120/26390_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ErikNaslund
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>+1 to what <a class="mention" href="/u/mindok" rel="nofollow">@mindok</a> said - I’ve also had great success shelling out to Typst.</p>
<p>I tried my best to look around for options before making the decision, and Typst fit the sweetspot for me since it’s lightweight, easy to use, very quick, and capable of complicated layouts. Using a headless browser is always an option, but it added more complexity and grew my docker images more than I liked.</p>
<p>You can have a look at <a href="https://typst.app/universe/search/" class="inline-onebox" rel="noopener nofollow ugc">Search — Typst: Universe</a> for lots of example Typst templates, so you can get a feeling for what you can do with it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345632" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-345632" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345632"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="345636" data-post-id="345636">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mindok" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mindok/120/13538_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mindok
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="ErikNaslund" data-post="12" data-topic="67278">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/eriknaslund/48/26390_2.png" class="avatar"> ErikNaslund:</div>
<blockquote>
<p>very quick</p>
</blockquote>
</aside>
<p>These guys wrote a blog post about mass generating contract notes (about 1.5M per trading day) for a financial institution using typst: <a href="https://zerodha.tech/blog/1-5-million-pdfs-in-25-minutes/" class="inline-onebox" rel="noopener nofollow ugc">1.5+ million PDFs in 25 minutes - Zerodha Tech Blog</a>. A different tech stack, but similar concept.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345636" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-345636" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345636"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="345651" data-post-id="345651">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cvkmohan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/120/39944_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cvkmohan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Very interesting discussion. My two cents:</p>
<ol>
<li>PDF generation is a very important feature for any enterprise application still. However, most developers would want to generate the pdf out of html, css whenever possible.</li>
<li>That said, <code>prawn</code> is a great ruby library. Using it via erlport may be a nice solution. However, if we are going via erlport sort of a solution, <code>weaslyprint</code> is a much better option I think. Mainly because, it can take html, css mix and generate pdf output.</li>
<li><code>wkhtmlpdf</code> has been a great solutoin - but - age is catching up with it. Very slow - not respecting the modern HTML - lack of full control over the output - are my main cribs about it.</li>
<li>Typst is a great alternative. I have gone through that article on how Zerodha used it. But, I am afraid for a regular application - how can typst bring value? When you have to generate pdfs at such volumes - format same - data different - yes typst might be useful. But, if you have some 40 models - and - each of their list view in print needs slightly different variations - building a typst format for each of them - and maintaining the code might be difficult. Developer would prefer a library that takes the same html that he generated for the list view to be taken - and if he gets a reasonable pdf - that might help him.</li>
<li>Headless browser sort of solutions are quite irritating. Atleast my experience has been that. Lack of any control over what gets into pdf - specially - if we are rendering tables that run into multiple pages - it is absolutely nightmare.<br>
Definitely a modern solution for the pdf generation problem is due. Let us hope this discussion stimulates something.</li>
</ol> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345651" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-345651" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345651"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="345654" data-post-id="345654">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="D4no0" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/D4no0/120/33624_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  D4no0
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cvkmohan" data-post="14" data-topic="67278">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/48/39944_2.png" class="avatar"> cvkmohan:</div>
<blockquote>
<p>However, most developers would want to generate the pdf out of html, css whenever possible.</p>
</blockquote>
</aside>
<p>I think the assumption that developers want to use html to generate PDFs is not true for a lot of cases. The main argument is as a lot of people point above, there are lots of use-cases where you care about your pages layout, controlling that in html is not possible.</p>
<aside class="quote no-group" data-username="cvkmohan" data-post="14" data-topic="67278">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/48/39944_2.png" class="avatar"> cvkmohan:</div>
<blockquote>
<p>When you have to generate pdfs at such volumes - format same - data different - yes typst might be useful.</p>
</blockquote>
</aside>
<p>Compared to other languages, you have a powerful templating engine at your disposal: <code>EEx</code>. You can use it to define highly configurable templates, so I’m not sure there is anything different from how you would use phoenix.</p>
<p>I’ve used latex before to compile some huge report PDFs using <code>EEx</code> templates, it worked absolutely great. If I remember correctly I was using <a href="https://github.com/maennchen/iona" rel="noopener nofollow ugc">iona</a>, but I forked and added some additional features it was missing.</p>
<p>The problem was that latex compiler is just horrible, both performance-wise and how it operates, so having better alternatives these days is absolutely great.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345654" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-345654" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345654"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="345656" data-post-id="345656">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cvkmohan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/120/39944_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cvkmohan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I agree. It was an overly generic statement to say that developers want pdf from html and css. All I wanted to say is configurability and ease of generation - both are quite important in the solution. It did not come out correctly.<br>
I agree - building configurable templates does provide a scalable and modern solution - that does not rely on the headless browser - can be a viable solution.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345656" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-345656" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345656"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="345657" data-post-id="345657">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="imprest" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/imprest/120/12541_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  imprest
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<div class="youtube-onebox lazy-video-container" data-video-id="FF9lSxeQkwA" data-video-title="Generate PDF documents in LiveView,  part 10 Phoenix-Liveview" data-video-start-time="" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=FF9lSxeQkwA" target="_blank" class="video-thumbnail" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://i.ytimg.com/vi/FF9lSxeQkwA/hqdefault.jpg" title="Generate PDF documents in LiveView,  part 10 Phoenix-Liveview" width="480" height="360">
  </a>
</div>

<p>Just wanted to share above that shows typst usage with elixir / liveview.</p>
<p>Only think missing will be to use Eex to precompile templates but maybe the additional complexity not necessary for smaller projects.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345657" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-345657" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345657"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="345658" data-post-id="345658">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="D4no0" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/D4no0/120/33624_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  D4no0
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This sounds like an interesting project that I might pick up this winter, as I will need an alternative latex tool for some of my personal projects, where generation from html doesn’t cut it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345658" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-345658" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345658"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="345673" data-post-id="345673">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ErikNaslund" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ErikNaslund/120/26390_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ErikNaslund
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>FWIW the way I went about creating configurable templates in Typst was to use the <a href="https://typst.app/docs/reference/data-loading/json/" rel="noopener nofollow ugc">json function</a>.</p>
<p>I simply have Elixir write a JSON file with the context data, and the .typst file then makes use of it like this:</p>
<p><strong>context.json</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{"x": 42}
</code></pre>
<p><strong>document.typst</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">#let ctx = json("context.json")

This is a Typst document, and x is #ctx.x
</code></pre>
<p>Like <a class="mention" href="/u/d4no0" rel="nofollow">@D4no0</a> mentioned we also got access to great EEx templates. I’m not sure why I didn’t think of doing it that way. I sounds like a pretty clever solution.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345673" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-345673" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345673"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="345895" data-post-id="345895">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="infinityfye" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/infinityfye/120/15006_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  infinityfye
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Throwing my two cents for Typst as well. I’ve been using it with all stacks. But with EEx the experience is much smoother. I have been using it exactly like <a class="mention" href="/u/eriknaslund" rel="nofollow">@ErikNaslund</a> mentioned.<br>
I have to give a shout out to <a href="https://hex.pm/packages/ex_typst" class="inline-onebox" rel="nofollow">ex_typst | Hex</a> as well, if you want to programmatically do things with Typst this is great.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345895" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-345895" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345895"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="345925" data-post-id="345925">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ErikNaslund" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ErikNaslund/120/26390_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ErikNaslund
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/infinityfye" rel="nofollow">@infinityfye</a> ex_typst looks really great. Nice to have a NIF which calls the Typst code instead of having to include the binary like I’m doing.</p>
<p>I need to include images in my generated PDF. Looking at the ex_typst docs and source I can’t find a way to do that using ex_typst, so I thought I might as well ask if you know if it’s possible, since you’ve used the library?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="345925" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-a-prawn-like-pdf-generation-library-in-elixir/67278/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-345925" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="345925"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/67278/load_more?page=3">Load more posts (10 remaining)</a>
</div></template></turbo-stream>