Migrating from PDFShift or ScreenshotOne
Sahifa accepts the same requests as PDFShift v3 and ScreenshotOne. For most integrations the move is one line: the base URL. This page lists what else to check.
From PDFShift
- https://api.pdfshift.io/v3/convert/pdf
+ https://api.sahifa.dev/v3/convert/pdf
- Authentication: the same. Basic authentication with user
apiand your Sahifa key, or theX-API-Keyheader. - Parameters:
source,format,landscape,margin,header,footer,pages,zoom,use_print,delay,wait_for,css,javascript,auth,cookies,http_headers,raise_for_status,encodebehave as documented by PDFShift.
Differences
| Option | Sahifa |
|---|---|
filename, webhook, s3_destination | Refused with 400. Files are returned in the response only and never stored. Store them yourself after the call. |
header.start_at, footer.start_at | Not supported. |
Header or footer without margin | Refused with 400; add a margin that fits the header. |
sandbox | Accepted and ignored. |
timeout | Capped at 30 seconds. |
From ScreenshotOne
- https://api.screenshotone.com/take
+ https://api.sahifa.dev/take
- Authentication: the same
access_keyparameter, with your Sahifa key. - Signed URLs: the
signatureparameter is not checked. Keep calls on your server. - Parameters: the viewport, full page, element and clip options, formats,
wait_until,delay, dark mode, headers and cookies, and the blocking options (block_ads,block_trackers,block_cookie_banners,block_chats,hide_selectors,block_requests,block_resources) work as documented by ScreenshotOne.
Differences
| Option | Sahifa |
|---|---|
store, storage_*, async, webhook_url | Refused with 400; nothing is stored. |
block_banners_by_heuristics | Refused with 400; use block_cookie_banners and hide_selectors. |
cache | Accepted and ignored: every request is rendered fresh. |
viewport_device, video, GIF, AVIF | Not supported yet. Set viewport_width, viewport_height and device_scale_factor directly. |
timeout | Capped at 30 seconds. |
A safe switch-over
- Put the base URL and key in configuration, not in code.
- Render a sample of your real documents with both services and compare them side by side.
- Switch a small share of traffic, watch error rates and times, then switch the rest.
- Keep the old configuration for a few weeks in case you need to go back.
Need help comparing results for your documents? Write to support@sahifa.dev.