
Automate PDF Refrying for Print Production
PDF refrying is a production technique that converts a PDF to PostScript and then converts that PostScript into a new PDF. Organizations use this roundtrip when a downstream raster image processor (RIP) or other system cannot process particular PDF content as expected, or when an established process requires a regenerated PDF after a PostScript stage.
The pdfRest PDF to PostScript API Tool and pdfRest Convert to PDF API Tool let developers automate both conversions as a controlled application process. An application can create the intermediate PostScript resource, pass its returned resource ID directly into the second conversion, and retain the source, intermediate, and final resource IDs with the job record. This replaces workstation-dependent print and export steps with a consistent, traceable workflow.
Because PostScript cannot represent every structure and capability available in PDF, refrying is a targeted compatibility technique rather than a general improvement for every file. Preserve the source PDF and validate the regenerated PDF against the system that will receive it.
PDF Refrying at a Glance
- Input: An existing PDF
- Intermediate format: PostScript
- Output: A newly generated PDF
- Best used for: A tested compatibility requirement or established PostScript-based process
- Main trade-off: PDF-specific structure and functionality may be removed or transformed
When PDF Refrying Can Help
The PostScript stage can transform, flatten, or omit PDF-specific content that is not represented in the same way in PostScript. Converting that representation back to PDF creates a new document that may be easier for a particular downstream system to process.
A refrying process may be appropriate when:
- A RIP or other production system rejects or incorrectly renders certain PDF content.
- An established process requires every document to pass through a PostScript stage.
- A service needs to apply the same conversion settings consistently across many jobs.
- An organization wants to replace manual print or export steps with an application-controlled process.
Some applications use refrying for every file in a defined job type. Others invoke it only after an incoming PDF encounters a known validation, rendering, or processing problem. In either case, the resulting PDF should be tested against the actual destination process rather than assumed to be an improved version of the source.
How the Two-Step PDF Refrying Process Works
A pdfRest refrying process uses two API requests:
- Send the source PDF to the
POST /postscriptendpoint and define the settings for the intermediate PostScript file. - Capture the output resource ID returned by the PDF to PostScript request.
- Pass that resource ID as the
idinput to thePOST /pdfendpoint, optionally supplying an Adobe PDF settings file. - Retrieve the regenerated PDF and retain the source when its original structure or functionality may still be needed.
The application does not need to download the intermediate PostScript file and upload it again. It can pass the managed resource ID directly from the first conversion to the second.
PDF Refrying Tutorials and Code Examples
Follow the tutorial for your preferred programming language or development environment to see complete request and response examples:
- How to Refry a PDF in .NET with C#
- How to Refry a PDF with cURL
- How to Refry a PDF with Java
- How to Refry a PDF with JavaScript in NodeJS
- How to Refry a PDF with PHP
- How to Refry a PDF with Python
Each tutorial demonstrates how to convert the source PDF to PostScript, pass the intermediate resource to the second API call, and retrieve the regenerated PDF.
Configure the Intermediate PostScript File
The PDF to PostScript request controls how pdfRest creates the intermediate file. Available choices include PostScript Level 2 or Level 3, page selection, binary output, scaling, rotation, shrink-to-fit behavior, and printable annotation handling.
These settings can become part of an application configuration or job profile, ensuring that each document receives the same conversion treatment rather than relying on choices made by an individual operator.
When printable annotations are included, their visual appearances can be rendered into the PostScript output. The annotations themselves do not remain interactive PDF objects after the roundtrip.
Apply an Adobe PDF Settings File
An Adobe PDF settings file, sometimes called an Adobe PDF preset, is a reusable .joboptions file that controls how the PostScript source is converted into the new PDF. It can define output choices such as PDF compatibility, font embedding, image compression, and other settings required for a particular destination.
Use a settings file when the workflow requires defined and repeatable output. The file is separate from the PostScript input, so an application can upload it with the Convert to PDF request or supply the job_options_id of a previously uploaded resource. The settings file is optional; omitting it applies the service defaults.
The PostScript-to-PDF conversion uses Datalogics PDF Converter SDK, maintained in partnership with Adobe using the same Adobe technology that powers Distiller.
What Changes During PDF Refrying?
Refrying is a format roundtrip, not an edit-preserving PDF operation. The regenerated PDF is built from the PostScript representation rather than from the original PDF object structure.
Tags, form fields, layers, links, bookmarks, annotations, metadata, embedded files, digital signatures, and other interactive structures do not carry forward as equivalent features. Some visual appearances may be incorporated into the page content, while unsupported structures may be omitted. Transparency, font handling, color, image resolution, text extraction, editability, and file size can also change according to the source content and selected conversion settings.
This transformation is the reason refrying can help with a defined processing problem: content that causes difficulty for the receiving system may be normalized, flattened, or removed during the roundtrip. It is also the reason teams should retain the source PDF and test the regenerated document carefully.
When Not to Refry a PDF
Do not apply refrying as a default repair, optimization, or modernization step for every PDF. Use it when a known destination requirement or tested compatibility problem justifies the conversion.
Refrying may not be appropriate when the workflow must preserve:
- Accessibility tags and logical reading order
- Fillable form fields
- Layers and optional content
- Links, bookmarks, or interactive annotations
- Embedded files or multimedia
- Existing digital signatures
- The original document structure for future editing or archival purposes
Use a more targeted PDF operation when the actual goal is to flatten forms, rasterize pages, process transparency, create a particular PDF standard, or change one specific part of the document without performing a full PostScript roundtrip.
PDF Refrying FAQs
What Is PDF Refrying?
PDF refrying is a PDF-to-PostScript-to-PDF roundtrip. The first conversion creates a PostScript representation of the source PDF, and the second generates a new PDF from that PostScript file.
When Should an Application Refry a PDF?
An application should refry a PDF when a tested downstream requirement calls for a PostScript-generated PDF or when the roundtrip is known to resolve a specific rendering, RIP, output, or processing problem.
Should Every PDF Be Refried?
No. Refrying is a lossy compatibility technique, not a general best practice for all PDFs. Apply it only to defined jobs or known processing conditions, and preserve the original document.
Is PDF Refrying Guaranteed to Repair a Problematic PDF?
No. Refrying can work around certain problems by transforming the document through PostScript, but it is not a guaranteed PDF repair method. Results depend on the source file, the conversion settings, and the behavior of the destination system.
Can You Apply an Adobe PDF Settings File During Refrying?
Yes. Supply an Adobe PDF settings file in .joboptions format or provide its existing pdfRest resource ID with the PostScript-to-PDF request. Omitting the file uses the default conversion settings.
Can You Run Both Steps Without Downloading the Intermediate File?
Yes. The PDF to PostScript response returns an output resource ID. Pass that resource ID to Convert to PDF as the PostScript input, then retrieve or use the final PDF resource returned by the second request.
Does PDF Refrying Preserve Tags, Forms, and Other PDF Features?
No. PDF-only structures do not remain equivalent features through the PostScript roundtrip. Some visual appearances may become part of the static page content, but the original interactive objects and document structure are not preserved.
Automate a Tested PDF Refrying Process
pdfRest provides both conversion stages needed to incorporate PDF refrying into an application or document-processing service. When refrying is part of a defined process, test representative documents against the actual destination system, standardize the PostScript and Adobe PDF settings, preserve the source PDF, and retain the response resource IDs when the workflow requires traceability.
Try representative files in API Lab, choose one of the PDF refrying tutorials above for a complete code example, or review the PDF to PostScript API reference and Convert to PDF API reference. Explore additional production topics in the Prepress, Preflight, and Print learning hub.