Skip to content

Commit

Permalink
deploy: 1a1a6d7
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Nov 20, 2024
1 parent 23bfae0 commit c8e27c8
Show file tree
Hide file tree
Showing 57 changed files with 414 additions and 404 deletions.
4 changes: 3 additions & 1 deletion CombineWithPdfrw.html

Large diffs are not rendered by default.

28 changes: 18 additions & 10 deletions CombineWithPypdf.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions FAQ.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

<span class=n>pdf</span> <span class=o>=</span> <span class=n>FPDF</span><span class=p>()</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>add_page</span><span class=p>()</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s1>&#39;Times&#39;</span><span class=p>,</span> <span class=s1>&#39;B&#39;</span><span class=p>,</span> <span class=mi>15</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s1>&#39;Times&#39;</span><span class=p>,</span> <span class=n>style</span><span class=o>=</span><span class=s1>&#39;B&#39;</span><span class=p>,</span> <span class=n>size</span><span class=o>=</span><span class=mi>15</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>cell</span><span class=p>(</span><span class=n>w</span><span class=o>=</span><span class=mi>210</span><span class=p>,</span> <span class=n>h</span><span class=o>=</span><span class=mi>9</span><span class=p>,</span> <span class=n>text</span><span class=o>=</span><span class=n>title</span><span class=p>,</span> <span class=n>border</span><span class=o>=</span><span class=mi>0</span><span class=p>,</span>
<span class=n>new_x</span><span class=o>=</span><span class=s2>&quot;LMARGIN&quot;</span><span class=p>,</span> <span class=n>new_y</span><span class=o>=</span><span class=s2>&quot;NEXT&quot;</span><span class=p>,</span> <span class=n>align</span><span class=o>=</span><span class=s1>&#39;C&#39;</span><span class=p>,</span> <span class=n>fill</span><span class=o>=</span><span class=kc>False</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s1>&#39;Times&#39;</span><span class=p>,</span> <span class=s1>&#39;B&#39;</span><span class=p>,</span> <span class=mi>15</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s1>&#39;Times&#39;</span><span class=p>,</span> <span class=n>style</span><span class=o>=</span><span class=s1>&#39;B&#39;</span><span class=p>,</span> <span class=n>size</span><span class=o>=</span><span class=mi>15</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>cell</span><span class=p>(</span><span class=n>w</span><span class=o>=</span><span class=mi>0</span><span class=p>,</span> <span class=n>h</span><span class=o>=</span><span class=mi>6</span><span class=p>,</span> <span class=n>text</span><span class=o>=</span><span class=n>heading</span><span class=p>,</span> <span class=n>border</span><span class=o>=</span><span class=mi>0</span><span class=p>,</span>
<span class=n>new_x</span><span class=o>=</span><span class=s2>&quot;LMARGIN&quot;</span><span class=p>,</span> <span class=n>new_y</span><span class=o>=</span><span class=s2>&quot;NEXT&quot;</span><span class=p>,</span> <span class=n>align</span><span class=o>=</span><span class=s1>&#39;L&#39;</span><span class=p>,</span> <span class=n>fill</span><span class=o>=</span><span class=kc>False</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s1>&#39;Times&#39;</span><span class=p>,</span> <span class=s1>&#39;&#39;</span><span class=p>,</span> <span class=mi>12</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s1>&#39;Times&#39;</span><span class=p>,</span> <span class=n>style</span><span class=o>=</span><span class=s1>&#39;&#39;</span><span class=p>,</span> <span class=n>size</span><span class=o>=</span><span class=mi>12</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>multi_cell</span><span class=p>(</span><span class=n>w</span><span class=o>=</span><span class=mi>0</span><span class=p>,</span> <span class=n>h</span><span class=o>=</span><span class=mi>5</span><span class=p>,</span> <span class=n>text</span><span class=o>=</span><span class=n>text</span><span class=p>)</span>
<span class=n>response</span><span class=o>.</span><span class=n>headers</span><span class=p>[</span><span class=s1>&#39;Content-Type&#39;</span><span class=p>]</span> <span class=o>=</span> <span class=s1>&#39;application/pdf&#39;</span>
<span class=k>return</span> <span class=n>pdf</span><span class=o>.</span><span class=n>output</span><span class=p>()</span>
Expand Down
6 changes: 3 additions & 3 deletions TextColumns.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<span class=k>with</span> <span class=n>pdf</span><span class=o>.</span><span class=n>text_columns</span><span class=p>(</span><span class=n>text_align</span><span class=o>=</span><span class=s2>&quot;J&quot;</span><span class=p>,</span> <span class=n>ncols</span><span class=o>=</span><span class=mi>3</span><span class=p>,</span> <span class=n>gutter</span><span class=o>=</span><span class=mi>5</span><span class=p>)</span> <span class=k>as</span> <span class=n>cols</span><span class=p>:</span>
<span class=n>cols</span><span class=o>.</span><span class=n>write</span><span class=p>(</span><span class=n>text</span><span class=o>=</span><span class=n>LOREM_IPSUM</span><span class=p>[:</span><span class=mi>600</span><span class=p>])</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s2>&quot;Times&quot;</span><span class=p>,</span> <span class=s2>&quot;&quot;</span><span class=p>,</span> <span class=mi>18</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s2>&quot;Times&quot;</span><span class=p>,</span> <span class=n>size</span><span class=o>=</span><span class=mi>18</span><span class=p>)</span>
<span class=n>cols</span><span class=o>.</span><span class=n>write</span><span class=p>(</span><span class=n>text</span><span class=o>=</span><span class=n>LOREM_IPSUM</span><span class=p>[:</span><span class=mi>500</span><span class=p>])</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s2>&quot;Courier&quot;</span><span class=p>,</span> <span class=s2>&quot;&quot;</span><span class=p>,</span> <span class=mi>20</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s2>&quot;Courier&quot;</span><span class=p>,</span> <span class=n>size</span><span class=o>=</span><span class=mi>20</span><span class=p>)</span>
<span class=n>cols</span><span class=o>.</span><span class=n>write</span><span class=p>(</span><span class=n>text</span><span class=o>=</span><span class=n>LOREM_IPSUM</span><span class=p>[:</span><span class=mi>500</span><span class=p>])</span>
</code></pre></div> <img alt="Three Text Columns" src=tcols-three.png></p> <h4 id=balanced-columns>Balanced Columns<a class=headerlink href=#balanced-columns title="Permanent link">&para;</a></h4> <p>Normally the columns will be filled left to right, and if the text ends before the page is full, the rightmost column will be shorter than the others. If you prefer that all columns on a page end on the same height, you can use the <code>balance=True</code> argument. In that case a simple algorithm will be applied that attempts to approximately balance their bottoms.</p> <p><div class=highlight><pre><span></span><code><span class=kn>from</span> <span class=nn>fpdf</span> <span class=kn>import</span> <span class=n>FPDF</span>

Expand All @@ -35,7 +35,7 @@
<span class=n>cols</span> <span class=o>=</span> <span class=n>pdf</span><span class=o>.</span><span class=n>text_columns</span><span class=p>(</span><span class=n>text_align</span><span class=o>=</span><span class=s2>&quot;J&quot;</span><span class=p>,</span> <span class=n>ncols</span><span class=o>=</span><span class=mi>3</span><span class=p>,</span> <span class=n>gutter</span><span class=o>=</span><span class=mi>5</span><span class=p>,</span> <span class=n>balance</span><span class=o>=</span><span class=kc>True</span><span class=p>)</span>
<span class=c1># fill columns with balanced text</span>
<span class=k>with</span> <span class=n>cols</span><span class=p>:</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s2>&quot;Times&quot;</span><span class=p>,</span> <span class=s2>&quot;&quot;</span><span class=p>,</span> <span class=mi>14</span><span class=p>)</span>
<span class=n>pdf</span><span class=o>.</span><span class=n>set_font</span><span class=p>(</span><span class=s2>&quot;Times&quot;</span><span class=p>,</span> <span class=n>size</span><span class=o>=</span><span class=mi>14</span><span class=p>)</span>
<span class=n>cols</span><span class=o>.</span><span class=n>write</span><span class=p>(</span><span class=n>text</span><span class=o>=</span><span class=n>LOREM_IPSUM</span><span class=p>[:</span><span class=mi>300</span><span class=p>])</span>
<span class=c1># add an image below</span>
<span class=n>img_info</span> <span class=o>=</span> <span class=n>pdf</span><span class=o>.</span><span class=n>image</span><span class=p>(</span><span class=s2>&quot;.../fpdf2/docs/regular_polygon.png&quot;</span><span class=p>,</span>
Expand Down
Loading

0 comments on commit c8e27c8

Please sign in to comment.