DocSpring vs Prawn
Compare positioning every value by coordinates in code with dragging fields onto the PDF in a browser.
Our take
Prawn is a solid Ruby library for drawing PDFs from scratch, and we know it well because DocSpring uses Prawn internally to draw your data onto uploaded PDFs. The output quality is not the question. The question is how you find out that the customer's name belongs at x 118, y 642, and how you keep a hundred of those numbers right when the form changes.
With Prawn you measure coordinates by trial and error, regenerate the PDF, look, adjust, and repeat, and the result lives in Ruby code that nobody outside engineering can touch. With DocSpring you upload the PDF, drag the fields into place in the browser, and send JSON. Choose Prawn if you are generating a new document from nothing in Ruby and do not need to overlay on an existing form. Choose DocSpring if you are filling PDFs somebody else designed, if the forms change, or if your stack is not Ruby.
Maintenance matters here too. Prawn itself is stable but quiet, with one release since 2023. The gems that bolt on the missing pieces are worse off. prawn-table, which provides tables, last shipped in 2015. prawn-templates, which loads an existing PDF as a page template, last shipped in 2019 and its own README calls it unsupported, buggy, and use at your own risk. prawn-blank and prawn-forms, which add AcroForm fields, have not been updated since 2013 and 2014. A Prawn-based form filler in 2026 is a stack of abandoned dependencies that you maintain yourself.
Where the coordinates come from
Prawn gives you a canvas. You call draw_text, bounding_box, table, and image with positions in PDF points measured from the bottom-left corner of the page. It has no concept of an existing form or a field. To fill a government form or a partner's PDF you generate a transparent overlay and stamp it onto the original with another library, and the positions come from measurement.
The extension gems that used to close those gaps are no longer looked after. prawn-templates, the official way to use an existing PDF as a background, has not had a release since 2019 and is documented as unsupported. prawn-blank and prawn-forms, which created AcroForm fields, stopped in 2013 and 2014 and predate every current Prawn release. What remains is Prawn for drawing plus HexaPDF or CombinePDF for stamping, held together by code you write.
DocSpring's template editor shows the PDF page and lets you drag fields onto it, import existing AcroForm fields, set types and validation, and preview with sample data. The field positions become part of a versioned template that the API fills. The drawing is still done by Prawn behind the scenes.
Choose DocSpring to fill existing PDFs without measuring anything
You have forms that were designed elsewhere, they change from time to time, and you want people who are not Ruby developers to be able to adjust field positions. You may also need web forms, signatures, or a non-Ruby integration.
Choose Prawn to draw new documents in Ruby
You are producing reports or receipts from scratch, you want full control over every line, and you are happy for the layout to live in code. You have no existing PDF to overlay onto.
Feature comparison
Follow the feature links for details in DocSpring's documentation. Sources for each Prawn cell are listed at the end of the page.
Scroll the table sideways to see both products.
| What you need | DocSpring | Prawn |
|---|---|---|
| Templates | ||
| Fill an existing PDF | Yes Overlay fields on your PDF. Import existing form fields or place your own. | Conditions apply: Coordinates in code Prawn draws new pages. Overlaying on an existing PDF needs a second library to stamp the pages, since prawn-templates is unmaintained, and every value is positioned by x/y coordinates you measure yourself. |
| Visual document design | No Use an existing PDF or write HTML/CSS. The field editor does not design the document layout. | No No editor. Layout is Ruby code. |
| HTML to PDF | Yes HTML/CSS and Liquid templates, with code editors and a PDF preview. | No Prawn does not render HTML or CSS. Rich layouts are built from its drawing primitives. |
| Repeat a list of items | Yes Liquid loops create growing tables in HTML templates. Fields on an uploaded PDF can address array items without changing the page layout. | Yes Ruby loops and the prawn-table gem handle repeated rows, with automatic page breaks. |
| Conditional content | Yes Show or require PDF fields with conditional rules. Use Liquid conditions for HTML content. | Yes Any Ruby conditional. |
| Template versioning | Yes Edit drafts, publish numbered versions, and pin API requests to a version. | Conditions apply: Your responsibility Layouts are code, versioned by your repository. Coordinate changes ship with your deploys. |
| Editable PDF output | Yes Keep text and checkbox fields editable, or flatten the filled content. | No Prawn does not create or preserve AcroForm fields. The prawn-blank and prawn-forms gems that did are abandoned. |
| API integration | ||
| Synchronous generation | Yes Use sync.api.docspring.com to receive submission JSON and a PDF download URL in one request. | Yes Renders in your process and returns the PDF bytes. |
| Asynchronous generation | Yes Send wait=false to return immediately. Receive a webhook or check the submission status later. | Conditions apply: Your responsibility Background generation is your job queue. |
| Webhooks | Yes Receive notifications about PDF generation and Data Request events. | No Nothing to notify; it is a library call. |
| Batch PDF generation | Yes Generate up to 50 PDFs in a request with different templates and data. | Conditions apply: Your responsibility Loop in Ruby. CPU-bound rendering runs in your workers. |
| Combine PDFs | Yes Combine generated PDFs and other PDF files into one document. | No Combining PDFs needs HexaPDF or CombinePDF. |
| Forms and e-signatures | ||
| Embed the template editor | Yes Embed the PDF field editor and choose which controls your users can access. | No No editor exists. |
| Collect data with forms | Yes Generate web forms from your PDF template fields, or let people fill in the PDF visually. | No Does not collect data. |
| Electronic signatures | Yes Data Requests support ESIGN/UETA signing workflows. Your app supplies authentication details and sends notifications. | No No signing workflow. |
| Security and deployment | ||
| SOC 2 Type II | Yes Completed audit. Request the report through our Trust Portal. | Conditions apply: Your responsibility The library has no audit. Your hosting and processes determine compliance. |
| HIPAA compliance | Yes HIPAA compliant. Sign a BAA before submitting protected health information; contact [email protected]. | Conditions apply: Your responsibility Documents stay in your infrastructure. The controls are yours to prove. |
| Automatic document deletion | Yes Set an expiry per template for submission data, generated PDFs, and uploaded images. | Conditions apply: Your responsibility Output goes wherever your code writes it. |
| US and EU hosting | Yes Choose the US or EU service region. | Conditions apply: Your responsibility Runs wherever your Ruby application runs. |
| Self-hosting | Yes: Enterprise Self-hosted enterprise licenses are available. | Yes Self-hosted only. Free under Ruby, GPLv2, or GPLv3 licensing. |
"Limited or your responsibility" marks things the library only partly covers or leaves to your own code and infrastructure. Plan requirements and product boundaries are noted in the cells.
Fill an application form with a name and email address
Suppose you have an application form as a PDF with spaces for a customer's name and email. Your Ruby application already has both values. Compare how each approach decides where they go on the page.
In DocSpring
Upload the PDF. Drag a text field onto the name line and another onto the email line, or import the fields if the PDF already has them. Name them customer_name and customer_email, preview with sample data, and publish.
Send the JSON from Ruby with the official client library or plain HTTP. The response includes the filled PDF's download URL. When the form changes, adjust the fields in the editor rather than in code.
In Prawn
Open the PDF in a viewer, estimate where the name line is, convert that to points from the bottom-left corner, write draw_text with those coordinates, render, look, and adjust. Repeat for each field.
Prawn cannot draw onto the original PDF, so generate a transparent overlay and stamp it onto each page with HexaPDF or CombinePDF. When the form changes, repeat the measuring.
Fill the form with Prawn
Two libraries, hand-measured coordinates, and a stamping step. This is the workflow DocSpring replaces.
require 'prawn'
require 'hexapdf'
# Prawn draws a blank overlay. Every value needs x/y coordinates in PDF points,
# measured from the bottom-left corner of the page, found by trial and error.
Prawn::Document.generate('overlay.pdf', page_size: 'LETTER', margin: 0) do
font_size 11
draw_text 'Mira Patel', at: [118, 642]
draw_text '[email protected]', at: [118, 618]
end
# Then stamp the overlay onto the original form with another library.
form = HexaPDF::Document.open('application.pdf')
overlay = HexaPDF::Document.open('overlay.pdf')
form.pages.first.canvas(type: :overlay).xobject(form.import(overlay.pages.first.to_form_xobject), at: [0, 0])
form.write('filled.pdf')
Fill the form with DocSpring
The fields were placed in the browser. The request only carries the data.
curl --fail-with-body \
"https://sync.api.docspring.com/api/v1/templates/${DOCSPRING_TEMPLATE_ID}/submissions" \
--user "${DOCSPRING_TEST_TOKEN_ID}:${DOCSPRING_TEST_TOKEN_SECRET}" \
--header 'Content-Type: application/json' \
--data '{
"test": true,
"data": {
"customer_name": "Mira Patel",
"customer_email": "[email protected]"
}
}'
Set the environment variables to your template ID and test API credentials. Accounts in our EU region send requests to sync.api-eu.docspring.com instead. The response includes a download URL for a watermarked PDF. See the request and response guide.
Change the form's layout by a few millimeters and see how long it takes to update each approach. Then hand the task to someone who does not write Ruby.
A free gem, and the hours to place every field
DocSpring
The Starter plan is $49 per month for 50 live PDFs, then 25c per additional PDF. Larger plans lower the per-PDF price. Every plan includes unlimited templates, users, and watermarked test PDFs, and there is a free trial with no card required.
See all DocSpring plansPrawn
Prawn is free. The cost is the time spent measuring and re-measuring coordinates, the second library and the stamping code for existing PDFs, and the fact that every layout change is an engineering ticket.
For documents drawn from scratch with stable layouts, that cost can be low and Prawn is a fine choice.
A ten-field form filled with Prawn is an afternoon of coordinate tuning the first time and an hour every time the form changes. In DocSpring it is a few minutes of dragging fields, by anyone on the team.
Moving from Prawn to DocSpring
Upload each original PDF to DocSpring and place the fields visually. If a PDF has AcroForm fields, import them and the names are done. Your existing coordinate constants can guide the first placement, but you will not need to keep them.
Replace the Prawn and stamping code with an API call using the DocSpring Ruby client. Map your data hash to the field names. Keep Prawn for any documents you genuinely draw from scratch, or move those to HTML/CSS templates in DocSpring.
Test each form with long values, checkboxes, and multi-page output. Then delete the overlay code.
Questions about Prawn and DocSpring
Does DocSpring use Prawn?
Yes. DocSpring uses Prawn to draw field values onto uploaded PDFs. The difference is that the coordinates come from a visual editor and a versioned template, not from constants in your code.
Can Prawn fill an existing PDF form?
Not by itself. Prawn creates new pages. To fill an existing form you draw an overlay at measured coordinates and stamp it onto the original with another library such as HexaPDF.
Is Prawn still maintained?
Prawn receives occasional releases, the latest being 2.5.0 in March 2024, and works fine for drawing new documents. The extension gems for existing PDFs and form fields, prawn-templates, prawn-blank, and prawn-forms, have had no releases since 2019, 2013, and 2014 and should not be used in new projects.
I only use Ruby. Is DocSpring a good fit?
Yes. DocSpring has an official Ruby client library, and the JSON API works from any language. The editor runs in the browser, so non-developers can adjust templates too.
About this comparison
We reviewed DocSpring's documentation and implementation alongside Prawn's published product, API, pricing, and security information. Prices and plan limits were checked on the review date shown at the top of the page. The workflows describe documented behavior; they are not performance benchmarks. Features and plans can change after the review date.
Sources
- Prawn project site
- Prawn manual (text positioning and tables)
- Prawn on GitHub (license and templates status)
- Prawn release history on RubyGems
- prawn-templates on GitHub (unsupported notice)
- prawn-blank release history on RubyGems
- DocSpring Ruby client library
Spotted something that needs correcting? Send us the detail and a source.
Related comparisons
Product names, logos, and brands are the property of their respective owners and are used here for identification and comparison only. Their use does not imply any affiliation with or endorsement by those companies.
Upload your PDF and place the fields in a browser
Upload a PDF or create an HTML template, then send a test request.