<div dir="ltr">Thanks all for the interesting ideas.<div><br></div><div>Jay, I like the idea of using flying saucer. Not sure about the implementation of <a href="https://github.com/amardaxini/acts_as_flying_saucer">https://github.com/amardaxini/acts_as_flying_saucer</a> if that's what you mean. <a href="https://github.com/crispymtn/flying_ruby_saucer">https://github.com/crispymtn/flying_ruby_saucer</a> looks a bit nicer.</div><div><br></div><div>Roland, I think you were correct about it not being the right fit. Still an interesting idea worth knowing about.</div><div><br></div><div>Sam, that could work in tandem with the flying saucer approach.</div><div>I've probably invested a bit too much time to want to jump back to generating HTML. My first attempt was using wicked_pdf and the underlying renderer didn't support some of the things I needed to do.</div><div><br></div><div>Josh, I'm probably going to go with an approach like this maybe using some of either Gerhard or Craig's ideas. <br>I think for me focusing on being able to generate individual components as an entire pdf which I can diff against would be useful. <br>Possibly using diff-pdf in an iterative fashion until finding the problematic pages, then components, then doing a visual diff on those.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 2, 2017 at 7:52 AM Jay Caines-Gooby <<a href="mailto:jay@gooby.org">jay@gooby.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">We use acts-as-flying-saucer - it generates pdfs from erb & css, so rather than testing the pdf itself, you could test the generated xhtml that creates the pdfs...</div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On 1 August 2017 at 20:00, Mark Burns <span dir="ltr"><<a href="mailto:markthedeveloper@gmail.com" target="_blank">markthedeveloper@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Has anyone any recommendations or suggestions for testing PDF generation?<div><br></div><div>I'm working on a side project and using Prawn. Which is great. I can programmatically generate large aspects of the content I want.</div><div><br></div><div>But so far I've been tweaking then looking at the result in the browser.</div><div>It's not an absolute nightmare - a few seconds to render. But it's hard to know whether the result is working without actually looking at it.</div><div><br></div><div>The DSL is nice, but very imperative. Mocking method calls out would be insane.</div><div><br></div><div>I'm managing to refactor into small objects to represent the components and layout, pages, typography aspects etc of the document. Which brings the complexity back down to manageable chunks. <br><br>But ultimately everything just calls underlying prawn DSL methods. So I can test little bits of logic that I have in my objects, but ultimately whether it works or not comes down to "have a look and see".</div><div><br></div><div>Perhaps the best I can hope for is screenshotting when I'm happy and using approvals to verify each major change hasn't radically borked everything.</div><div><br></div><div>It seems like there are tools to test which strings get into the document, but that seems like the easiest part. And probably the only part I'd be happy with test doubles for prawn and setting expectations on the text generating methods.</div></div>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div></div><div class="gmail_extra"><br><br clear="all"><div><br></div>-- <br><div class="m_3562339495125174998gmail_signature" data-smartmail="gmail_signature">Jay Caines-Gooby<br><a href="http://jay.gooby.org" target="_blank">http://jay.gooby.org</a><br><a href="mailto:jay@gooby.org" target="_blank">jay@gooby.org</a><br><a href="tel:+44%207956%20182625" value="+447956182625" target="_blank">+44 (0)7956 182625</a><br>twitter, skype & aim: jaygooby<br>gtalk: <a href="mailto:jaygooby@gmail.com" target="_blank">jaygooby@gmail.com</a><br></div>
</div>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div>