Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't have the exact answer, but I have and idea that's a bit more than a comment...</p> <p>Since you are already comfortable with the PDF specs, here's what you should try:</p> <p>Figure out how fpdf is actually drawing those lines. Chances are the pdf file it outputs is compressed, so you should download <a href="http://www.accesspdf.com/pdftk/" rel="nofollow noreferrer">pdftk</a> to uncompress it. You would do that with the command:</p> <pre><code> pdftk fpdf_output.pdf output fdf_readable.pdf uncompress </code></pre> <p>Open up the pdf in a text editor and see if the lines are drawn the same way as the example in the PDF specs you are looking at.</p> <p>If they are not, see if the method fpdf uses to draw the lines has an anti-aliasing option (in the PDF specs, I mean). If fpdf is drawing it the same way (or if their way has the option), try changing your output document (in the text editor) to have the anti-aliasing turned off. If the document won't open after editing it in the text-editor, you can run:</p> <pre><code> pdftk fdf_readable.pdf output fdf_fixed.pdf </code></pre> <p>and it should fix any broken references or byte counts.</p> <p>Then open up your tweaked pdf to see if it looks like what you are going after.</p> <p>Here's the bad news: The only thing the above accomplishes is verifying that anti-aliasing is or isn't possible via the methods fpdf is using under the hood. If it is possible, there is some hope that the feature already exists or that you can make a feature request or if you are feeling really confident, you could try to extend fpdf to include some kind of <code>antialias("true|false")</code> method. If the method they use to draw the lines is not the same as the specs and doesn't have an option to turn off anti-aliasing, your best bet is probably to find an alternative pdf generator, like <a href="http://www.tcpdf.org" rel="nofollow noreferrer">tcpdf</a>, and seeing if they offer that feature.</p> <h2>Update</h2> <p>Okay, I'd like to first point out that I still don't see the fuzziness. So I can't tell if this actually fixes your issue. But I did add the Automatic Stroke Adjustment rule to your example and the PDF still opens.</p> <p>In the interest of not posting the entire PDF again, here's how you can update your sample code:</p> <pre><code>......... /Font &lt;&lt; &gt;&gt; /XObject &lt;&lt; &gt;&gt; //Start my edit right below this point in your example, so at line 31, add: /ExtGState &lt;&lt; /GS1 10 0 R &gt;&gt; &gt;&gt; endobj 10 0 obj &lt;&lt; /Type /ExtGState /SA true /TR 11 0 R &gt;&gt; endobj 31 0 obj &lt;&lt; /FunctionType 0 /Domain [0.0 1.0] /Range [0.0 1.0] /Size 2 /BitsPerSample 8 /Length 7 /Filter /ASCIIHexDecode &gt;&gt; stream 01 00 &gt; endstream endobj // Your code picks back up with: 5 0 obj &lt;&lt; /Producer (FPDF 1.6) </code></pre> <p>Basically all I've done is added a dictionary object reference to the main resource dictionary and then created the actual dictionary object with the stroke adjustment rule set to true. I also threw in the transfer function that the spec example has, because i'm not sure if that makes a difference. It can easily be taken out.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload