Skip to content
Technical guide8 min read

How to Convert a Floor Plan PDF to JSON

By Floor Plan Analyzer, an AxcelerateAI practice

The practical challenge is making every exported object traceable to the right view, coordinate frame and drawing revision. This walkthrough follows a fictional room from crop pixels to a reviewable JSON record.

Fictional studio crop showing room R1, door D1, window N1 and a four-metre calibration reference
Original schematic of the fictional JSON fixture. The dimensions are stipulated for the example, not measured client data.

At a glance

Select the relevant page and view, extract geometry and positioned text, link rooms and openings to their evidence, and serialize the records with an explicit coordinate frame. Convert to physical units only after validating scale. Check both JSON structure and the overlay before using the result.

Download the fictional PDF-to-JSON example

Inventory the drawing before extracting objects

Record the file revision, page index, printed sheet label and view crop. A sheet can include a floor plan, an enlarged bathroom and a detail at different scales. Extract the intended view rather than counting objects from the entire sheet. Keep a coverage list for skipped and unreadable views.

Inspect native text and paths, then compare their position with a rendered page. A scanned page can contain an invisible OCR layer; native-looking text does not prove the geometry is vector. Conversely, a vector export can outline letters as paths, leaving no useful text objects. Choose the extraction method per region.

Inventory the drawing before extracting objects
Input evidenceStarting methodCheck before export
Selectable text and clean lineworkRead positioned text and vector pathsHatches and furniture are not walls
Raster scanRender or decode; segment and OCRSkew, erased openings and faint labels
Hybrid sheetCombine native evidence with targeted raster passesNo double count across the two sources

References: PyMuPDF Page reference: paths, text and coordinate transforms

Keep the coordinate transforms explicit

PyMuPDF exposes positioned text, drawing paths and rotation matrices. Its page reference distinguishes coordinates returned in unrotated page space from the rotated display frame. Record the actual render transform and crop offset used by your pipeline. A visually correct overlay at one zoom can still be wrong on a different rendition if coordinates are mixed.

In the fictional fixture, crop-local pixel point (200, 300) maps to (320, 380) on the full render by adding the crop origin (120, 80). This example has no rotation or resampling after cropping. For a deskewed or resized image, store the full affine transform and its direction; adding an offset alone is insufficient. Check at least three non-collinear control points before trusting the overlay.

References: PyMuPDF Page reference: paths, text and coordinate transforms

Work through the example and verify scale

The crop contains a fictional studio polygon from (100, 100) to (500, 300). The reference segment is 400 pixels and is stipulated to represent 4 metres. That gives 0.01 metres per pixel; at the same scale in both directions the room measures 4 × 2 m, or 8 m² under the drawn-boundary definition. The door span is 90 pixels or 0.90 m; the window span is 120 pixels or 1.20 m. These are geometric spans, not certified quantities.

On a real sheet, use an explicit dimension or other trusted reference in the same view. Cross-check a second dimension, preferably in the other axis, and investigate discrepancies before assigning one uniform scale. Image DPI measures the render, not the building. If scale cannot be confirmed, keep pixel coordinates and set physical dimensions to null. Do not apply a detail scale to the whole sheet.

Validate JSON structure and drawing semantics separately

RFC 8259 defines JSON syntax and its value types. A parser accepting a file tells you nothing about whether the polygon is closed by convention, whether IDs resolve or whether a dimension was converted correctly. Define a versioned schema for your importer and validate relationships and geometry separately.

Validate JSON structure and drawing semantics separately
CheckExample failureDisposition
Required fields and typesA width contains a formatted stringReject or migrate explicitly
Geometry and referencesDoor points do not lie on its host segmentFlag the association for review
Scale and provenanceMetric area lacks a calibration sourceWithhold the metric field
Coverage and releaseOne skipped view imported as emptyKeep skipped status and require review

References: RFC 8259: JSON interchange format

Run an overlay check before handing off the file

Reproject the exported objects onto the exact revision and inspect room edges, wall references, opening endpoints and text boxes. Include at least one rotated or cropped view, one missing scale and one ambiguous label in the acceptance set. Ask the receiver to verify that null stays unknown and that the review state is not lost during import.

Use stable local IDs within a result and maintain a separate cross-revision mapping only when justified. Keep rejected observations with source references instead of silently repairing them. Store the original and reviewed exports separately so a later re-extraction cannot overwrite a human decision.

Choose a manual, hybrid or tuned workflow

For a single simple drawing, manually tracing the required fields may be quicker than building an extractor. For repeated clean exports, vector and text parsing can give a useful starting point. Scanned or mixed archives often require segmentation, OCR and a reviewer to resolve uncertain labels and gaps. Compare the cost of review on representative drawings, not just the speed of export.

For a recurring workflow, bring a representative drawing family and the JSON fields your receiver actually uses. We fine-tune our drawing models on your conventions and engineer the validation and handoff. The sample file is an educational fixture, not a published API contract or model result.

Frequently asked questions

Can I convert a scanned PDF?

Yes, with a raster extraction and OCR workflow. Inspect the resulting overlay and retain unresolved boundaries and labels for review.

Is the sample a BIM model?

No. It is a simple drawing evidence record. The sample does not establish wall assemblies, elevations or a verified building model.

References and illustration notes

Sources support the terminology and interpretation notes cited above. Worked examples and diagrams are our own educational material, not client drawings or measured project results.

Start here

Try it on a drawing of your own

Reading about this is one thing. Send one sheet and we will run it through our models and send back what they find, with an overlay you can hold against the original.
  • One sheet is enough — PDF, DXF or a scan
  • Back in about 2 business days, with an annotated overlay
  • No call required, NDA on request

Send us one sheet

We run it through our floor plan models and send back the extracted data with an annotated overlay, so you can see what comes off your own drawings before anyone books a call.

  • Back in about 2 business days
  • PDF, DXF or a scan
  • NDA on request

After your enquiry is sent, you’ll go to Calendly to choose a discovery-call time. Booking is optional.

This is our base model, before any tuning for you. On a paid project we train it further on your own drawings, which is where the rest of the accuracy comes from. So this shows you the starting point, not the best we can do.

By submitting, you agree to our Privacy Policy. We never share your details.

Get in touch

Tell us what is on your drawings

Describe the sheets you get and what you need off them. We will tell you what our models already handle, what needs fine-tuning on your drawings, and what is not worth automating at all.

Reply time
Within 1 business day

Would rather show than tell? Send one sheet for a free analysis

After your enquiry is sent, you’ll go to Calendly to choose a discovery-call time. Booking is optional.

We reply within 1 business day.

By submitting, you agree to our Privacy Policy. We never share your details.

Drawing intelligence

Let’s start with your drawing.

Where should we send the next step?