DocSpring vs Prawn

Compare positioning everything by coordinates in Ruby with designing pages and placing fields 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 or the design changes.

There are two jobs here. To fill a PDF somebody else designed, DocSpring finds the fields when you upload it, even on a scan, AI names them, and you adjust them in the browser. To draw a new document, DocSpring's Page Designer lays it out on a blank page, with tables that carry on over the next page, images, QR codes, barcodes, headers, and page numbers. Its layout is JSON with a published schema, so your code or an AI assistant can build one too.

Prawn still gives you more control, with any vector shape and any TrueType font you embed, all in your own process with no network call. Choose Prawn if that control matters and the layout can live in Ruby. Choose DocSpring if the forms or designs change, if people outside engineering should edit them, 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. When you upload a PDF, DocSpring finds the fields on flat scans and fillable forms, and AI names them, sets their types, and groups repeated rows into lists. You review them, drag any field into place, and preview with sample data. The positions become part of a versioned template that the API fills, and Prawn still does the drawing behind the scenes. For documents with no PDF to start from, the Page Designer replaces the drawing code. You place text with fields, tables, images, QR codes, and barcodes on the page, and each submission fills in the design.

Choose DocSpring to fill PDFs and design new ones without coordinates

You have forms that were designed elsewhere, or documents your team wants to design visually, and they change from time to time. You want people who are not Ruby developers to adjust a field or a table, and you may also need web forms, signatures, delivery to S3 or Google Drive, or a non-Ruby integration.

Choose Prawn to draw documents entirely in Ruby

You are producing reports or receipts in Ruby, you want full control over every line and shape, your own fonts, and no network call, 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.

Available Not available Limited or your responsibility

Scroll the table sideways to see both products.

Prawn and DocSpring: filling existing PDFs, layouts, and operations
What you need DocSpring Prawn
Templates
Fill an existing PDF Yes Overlay fields on your PDF. Import its form fields, let AI find and name them, 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 Yes Build a PDF on a blank page in the Page Designer, with text, images, tables, charts, QR codes, barcodes, fillable form fields, headers and footers. An AI assistant can build one too, through the MCP server. 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 Tables and repeating sections in page designs, and Liquid loops in HTML and Word templates, carry on over as many pages as they need. Fields on an uploaded PDF can address array items. 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 in page designs, HTML and Word templates. Yes Any Ruby conditional.
Template versioning Yes Edit drafts, see what changed since the last version, publish numbered versions, and pin API requests to one. Conditions apply: Your responsibility Layouts are code, versioned by your repository. Coordinate changes ship with your deploys.
Editable PDF output Yes Keep a PDF template's text and checkbox fields editable, or flatten the filled content. Page designs can add fillable text fields, checkboxes, radio buttons and drop-downs. 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 signature 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 template editor on any paid plan, from Starter, for PDF, Word, page design and HTML templates, and choose which controls your users can access. No No editor exists.
Collect data with forms Yes Every template gets a web form you can share or embed, and a PDF template can also be filled in on the page. No Does not collect data.
Electronic signatures Yes Signature requests support ESIGN/UETA signing workflows on every plan, live once your account has made a payment. Signers sign in order or all at once. 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, with a BAA on every paid plan, including Starter. Sign it before sending health records. 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. DocSpring finds the name and email lines, or imports the fields if the PDF already has them, and AI names them. Rename them customer_name and customer_email if you like, 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, upload the new PDF and 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.

Ruby
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 'mira@example.com', 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.

Shell
curl --fail-with-body \
  "https://sync.api.docspring.com/api/v2/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": "mira@example.com"
    }
  }'

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 free Developer plan includes 200 credits a month. Paid plans start with Starter at $49 a month for 10,000 credits. A filled PDF form costs 20 credits (9.8¢ on Starter), a PDF from an HTML template or a page design 4, a Word document 20, and each person who signs a signature request 60; longer documents cost more, and keeping documents for more than 30 days uses a few storage credits a month. Larger plans lower the price to 0.9¢ per filled PDF form, unused paid-plan credits roll over for 12 months, and credit packs top up any plan. Every plan includes e-signatures, every paid plan includes the embedded template editor and a HIPAA BAA, and you can try a paid plan's features free for 14 days without a card.

See all DocSpring plans

Prawn

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, AI field setup finds and names the fields, and anyone on the team can move one. For documents you draw from scratch, 1,000 one-page receipts a month from a page design need a 5,000-credit pack on the free Developer plan, at $29. Prawn costs nothing per document, so for a stable layout that rarely changes it stays the cheaper choice.

Moving from Prawn to DocSpring

Upload each original PDF to DocSpring. It imports AcroForm fields, keeping their names if you choose, or finds the fields on a flat PDF and AI names them. Your existing coordinate constants can help you check 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. For documents you draw from scratch, rebuild the layout in the Page Designer, or as an HTML/CSS template if your team prefers code, or keep Prawn for them.

Test each form with long values, checkboxes, and multi-page output. Then delete the overlay code.

Discuss your documents with us.

Questions about Prawn and DocSpring

Ask us about your documents

Does DocSpring use Prawn?

Yes. DocSpring uses Prawn to draw field values onto uploaded PDFs. The difference is that the positions come from fields DocSpring finds and you adjust in a visual editor, stored in 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.

Can DocSpring replace Prawn for documents drawn from scratch?

Often. The Page Designer builds a PDF on a blank page with text and fields, tables and repeating sections that carry on over the next page, images, QR codes, barcodes, headers, footers, page numbers, and conditions. Its layout is a JSON document with a published JSON Schema, so your Ruby code, or an AI assistant connected through DocSpring's MCP server, can create and update designs. Prawn remains the better fit for freeform vector drawing, fonts outside the designer's list, or output that must be made in your own process.

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

Spotted something that needs correcting? Send us the detail and a source.

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, or design a new one, in your browser

Upload a PDF or a Word document, design a page, or write HTML, then send a test request. No credit card needed.

Product news by email

New features and changes, once a month.