Shipping API JSON -> 2 Auto-Named PDFs + 180 deg Label Fix
- Input Payload
- Raw Shipping API JSON (4.8 KB)
- Verified Output
- waybill_label.pdf (4x6 in, 180 deg -> 0 deg) + commercial_invoice.pdf (A4, 2 pages)
Paste a Base64 string or full shipping API JSON response. Runs 100% locally in your browser with instant PDF preview, 90/180 deg rotation, page splitting, and clipboard PNG copy.
Drop any file, paste Base64, or press Ctrl/Cmd+V with clipboard files or raw API JSON
Runs inside a local Web Worker. Network tab stays at 0 file POST requests.
Paste any Base64 string, Data URI, Postman JSON, SOAP XML, HAR, or EML payload on the left.
Load real client-side verified payloads straight into the workbench above. Zero third-party trademarks.
Keep confidential invoices and thermal shipping labels strictly inside browser memory while avoiding the blank-iframe bug common above 2 MB.
Logistics platforms, customs brokers, and billing microservices routinely return Base64-encoded PDFs inside JSON responses. Sending those payloads to a remote conversion server exposes customer addresses, tax IDs, and pricing terms to third-party logs or 24-hour retention buckets. Running quartet decoding inside a browser Web Worker keeps every octet local, verifiable by opening Network DevTools and observing zero outbound POST requests.
Developers who wire Base64 strings directly into an iframe or embed tag using data:application/pdf;base64 often see multi-page contracts vanish into a solid white rectangle. Chromium and WebKit enforce strict URL character ceilings around 2 MB; converting decoded Uint8Array bytes into a Blob and mounting URL.createObjectURL sidesteps the URL parser entirely so 50-page statements render crisply.
Each generated object URL is tracked in an explicit disposal registry. Switching attachments or pasting a fresh webhook response immediately calls URL.revokeObjectURL on superseded buffers, preventing long-lived support consoles from accumulating leaked PDF memory.
Paste raw Postman, HAR, or SOAP responses directly to split every embedded PDF into cleanly named tabs ready for instant review.
Carrier fulfillment endpoints rarely return a lone PDF string; they pack a 4x6 parcel label beside a commercial invoice and hazardous goods form inside deeply nested JSON objects or XML tags, frequently escaping forward slashes as \/ or appending \r\n escapes. Manually slicing out one substring per file wastes minutes on every support ticket.
Base64Doc walks the parsed JSON tree, XML elements, HAR response bodies, and MIME email parts recursively, testing every Base64 candidate against binary file signatures. When a sibling fileName or attachmentName field exists, the tab adopts it verbatim; otherwise, the outer JSON key name becomes the base filename, ending generic application (1).pdf clutter.
When an API response bundles three documents at once, you can preview each PDF individually in the top tab strip or export every extracted document together in one locally built .zip archive.
Fix upside-down 180-degree shipping labels, extract pages 1-2 from long contracts, and paste PNG screenshots straight into issue trackers.
Warehouse printers often expect portrait 288x432 pt PDFs while upstream dispatch APIs deliver landscape or inverted 180-degree pages. Base64Doc reads each page’s real /MediaBox and /CropBox coordinates and increments /Rotate modulo 360 using pdf-lib, preserving crisp vector barcodes and fonts without lossy re-encoding.
For 40-page supplier agreements where accounting only needs the signature sheet, the page-range splitter builds a clean subset PDF in milliseconds. If a document carries encryption dictionaries or AcroForm signatures, status badges surface those flags before you print or forward the file.
Need to attach page one inside an engineering ticket or team chat? Clicking Copy Page as PNG renders the active canvas through pdfjs-dist and writes a crisp raster image straight to the system clipboard.
Drop a raw string, a data:application/pdf;base64 URI, or an entire multi-kilobyte carrier JSON/XML response directly into the input area without manually stripping quotes or escaped slashes.
The worker scans for 25 50 44 46 2D (%PDF-1.x) headers, separates every nested document inside your response into named tabs using sibling fileName keys, and blocks corrupted payloads before download.
Adjust upside-down 4x6 thermal labels by updating /Rotate modulo 360 against each page’s real /MediaBox dimensions, extract a subset such as pages 1-2, or copy a high-DPI raster snapshot straight to your clipboard.
Download the corrected document via an ephemeral local Blob URL that revokes on cleanup, or bundle multiple extracted PDFs from one API call into a single .zip package.
| Capability | Base64Doc Behavior | Engineering Notes |
|---|---|---|
| PDF Header Signature | 25 50 44 46 2D (%PDF-1.0..2.0) | Validates leading magic bytes plus trailer %%EOF markers before rendering. |
| Page Box Geometry | /MediaBox & /CropBox (72 pt/in) | Detects 4x6 in (288x432 pt), A4 (595x842 pt), and US Letter (612x792 pt) sizes. |
| Rotation Math | (/Rotate + delta) mod 360 | Applied locally via pdf-lib without re-rasterizing vector text or barcodes. |
| Iframe Bypass Strategy | Uint8Array -> Blob URL | Avoids Chromium ~2 MB data:application/pdf URI truncation blank-page bugs. |
| Envelope Auto-Unpacking | JSON, SOAP XML, HAR, EML | Names outputs from outer property keys (e.g., waybill_label.pdf) automatically. |
Yes, Base64Doc parses nested JSON, SOAP XML, HAR, and EML envelopes automatically and opens separate named tabs for each embedded PDF. Filenames come from sibling fileName attributes or the enclosing JSON key such as waybill_label.pdf.
No, rotation runs entirely inside your browser via pdf-lib with zero network traffic. It inspects each page’s true /CropBox and /MediaBox bounds and updates /Rotate modulo 360 so 288x432 pt thermal proportions stay exact.
Chromium truncates inline data:application/pdf;base64 URIs once payloads cross roughly 2 MB. Base64Doc decodes raw octets into a Blob URL and renders pages via pdfjs-dist so large statements display reliably.
It requires the leading 25 50 44 46 2D (%PDF-) signature before enabling PDF download. If an upstream gateway returned a 502 HTML body or PK\x03\x04 archive, the extension guard blocks blind .pdf saving and reveals the true format.
Yes, enter a page range such as 1-2,5 in the PDF action bar to build and save a trimmed local PDF while keeping the original vector text intact.
Avoid Chrome data: URI truncation and memory leaks when rendering Base64 PDFs in JavaScript using Uint8Array, Blob URLs, and Web Workers.
Fix binascii.Error Incorrect padding and binary mode corruption when decoding Base64 PDFs, Excel sheets, and images in Python.
Diagnose why base64 -d, atob, or APIs fail with invalid input: data: prefixes, URL-Safe -/_ chars, JSON \/ escapes, whitespace, and missing =.
Understand the +33.3% Base64 expansion math, Data URI overhead, Vercel 4.5MB and AWS 6MB/10MB payload limits, and when to switch to binary uploads.
Eliminate garbled characters (mojibake) when decoding Korean EUC-KR/CP949, Japanese Shift_JIS, Chinese GB18030, or Cyrillic Base64 payloads.
Cross-platform cheat sheet comparing GNU/Linux base64 -d -w0, macOS BSD base64 -D -i/-o, and Windows PowerShell [Convert]::FromBase64String.
Diagnose why decoded Base64 to PDF files open blank, corrupted, or upside down: 2MB Data URI caps, JSON \/ escapes, HTML 502 payloads, and text writes.
Convert Base64 columns in Excel without add-ins using Power Query Binary.FromText, Office Scripts, or VBA MSXML2, and avoid 32,767 cell truncation.