TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: SnazzyPDF – Convert Any JSON Data to Beautifully Formatted PDFs

27 点作者 patafemma8 个月前
Hi HN,<p>I&#x27;m a freelance developer, and I built SnazzyPDF in my spare time to solve a problem I encountered frequently: converting structured data into PDF documents. The existing solutions I found either required manually creating a template or forced you to transform your data into a specific structure. I wanted a tool where you could simply input arbitrary JSON data and get a decent-looking document out. That&#x27;s why I built SnazzyPDF.<p>* Works with any JSON: No need to restructure your data. SnazzyPDF handles (almost) any JSON data, including deeply nested arrays and objects.<p>* Use REST API or drag &amp; drop web interface.<p>* Zero configuration: Convert your JSON to a finished PDF in seconds. Start simple and incrementally add customization.<p>* Save time: Automate PDF generation for reports, logs, or other structured data. No more manual formatting or custom export workflows.<p>* Free tier for testing or light use, paid plans that scale for larger needs.<p>I&#x27;d love to hear feedback from the HN community. Check it out, and let me know what you think! I&#x27;m happy to answer any questions. Thanks!

5 条评论

xupybd8 个月前
I think this is great but you might need to think about your point of difference. I suspect you have a product here but it might need some refining.<p>I asked Claude to create me something to do this. It worked first go.<p>import json from reportlab.lib.pagesizes import letter from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib import colors<p>def create_pdf_from_json(json_file, pdf_file): # Read JSON data with open(json_file, &#x27;r&#x27;) as file: data = json.load(file)<p><pre><code> # Create PDF document doc = SimpleDocTemplate(pdf_file, pagesize=letter) elements = [] # Add title styles = getSampleStyleSheet() elements.append(Paragraph(&quot;JSON Data Report&quot;, styles[&#x27;Title&#x27;])) elements.append(Paragraph(&quot;\n&quot;, styles[&#x27;Normal&#x27;])) # Create table data table_data = [[&quot;Key&quot;, &quot;Value&quot;]] for key, value in data.items(): table_data.append([str(key), str(value)]) # Create table table = Table(table_data, colWidths=[200, 300]) table.setStyle(TableStyle([ (&#x27;BACKGROUND&#x27;, (0, 0), (-1, 0), colors.grey), (&#x27;TEXTCOLOR&#x27;, (0, 0), (-1, 0), colors.whitesmoke), (&#x27;ALIGN&#x27;, (0, 0), (-1, -1), &#x27;CENTER&#x27;), (&#x27;FONTNAME&#x27;, (0, 0), (-1, 0), &#x27;Helvetica-Bold&#x27;), (&#x27;FONTSIZE&#x27;, (0, 0), (-1, 0), 14), (&#x27;BOTTOMPADDING&#x27;, (0, 0), (-1, 0), 12), (&#x27;BACKGROUND&#x27;, (0, 1), (-1, -1), colors.beige), (&#x27;TEXTCOLOR&#x27;, (0, 1), (-1, -1), colors.black), (&#x27;ALIGN&#x27;, (0, 0), (-1, -1), &#x27;CENTER&#x27;), (&#x27;FONTNAME&#x27;, (0, 1), (-1, -1), &#x27;Helvetica&#x27;), (&#x27;FONTSIZE&#x27;, (0, 1), (-1, -1), 12), (&#x27;TOPPADDING&#x27;, (0, 1), (-1, -1), 6), (&#x27;BOTTOMPADDING&#x27;, (0, 1), (-1, -1), 6), (&#x27;GRID&#x27;, (0, 0), (-1, -1), 1, colors.black) ])) elements.append(table) # Build PDF doc.build(elements) </code></pre> if __name__ == &quot;__main__&quot;: create_pdf_from_json(&quot;input.json&quot;, &quot;output.pdf&quot;)
评论 #41529539 未加载
评论 #41526984 未加载
评论 #41527027 未加载
godzillabrennus8 个月前
Neat but as others are saying this is for a technical audience and there is a lot of other options for this.<p>I could see some devs opting to use an open source software version and electing to host with your cloud hosting when devs do not want to bother keeping it securely hosted.<p>Small market though. Better to create a bunch of freemium sites to help normies do things with pdfs like convert them to docx or other image types… normies pay a fee to do a bunch of them, a big one, or to unlock a password protected one…
评论 #41529478 未加载
sylviangth8 个月前
I checked it out and it looks quite cool. I’m curious what the use cases for this are beyond invoice generation?
2Gkashmiri8 个月前
Is there any agpl compatible Python library or a product that creates PDF from json like this but has a wyswig PDF layout editor, like an invoice format builder ?
评论 #41537758 未加载
评论 #41538568 未加载
评论 #41538606 未加载
RadiozRadioz8 个月前
Looks nice, well done.<p>Though I worry about the narrowness and &quot;whip-up-ability&quot; for the price and target market. It&#x27;s a small enough featureset in a domain that skews technical, many would be inclined to template an HTML table to wkhtml2pdf and call it a day. Maybe they&#x27;d open source it after. I suppose you&#x27;re aiming for the people who wouldn&#x27;t do that, but would still expend the effort of integrating with an external HTTP API (and paying monthly for it)<p>I know a measure of a project&#x27;s usefulness is &quot;if a HN commenter says they could make it in a weekend but haven&#x27;t, you&#x27;ve got something!&quot;, so maybe I&#x27;m wrong.<p>P.s. 50 pages &#x2F; 1Mb per PDF is ludicrously far too small for a business tier.
评论 #41529427 未加载