ConvertToPDFX
PDF/X
Description
Prepares the open document for print exchange as a PDF/X file and checks the result
Syntax
Delphi
Function TPDFlib.ConvertToPDFX(TargetMode: Integer; Const ProfileFileName: WideString): Integer;Parameters
| TargetMode | 1 PDF/X-1a:2003, 2 PDF/X-3:2003, 3 PDF/X-4, 4 PDF/X-6, as in SetPDFXMode |
|---|---|
| ProfileFileName | The ICC profile of the printing condition (a CMYK output profile), or an empty string to keep the output intent the document already has |
Return values
| 1 | The document now conforms |
|---|---|
| 0 | It does not, or TargetMode was outside 1 to 4. Read GetPDFXConversionReport for what stands in the way |
Remarks
PDF/X needs a printing condition. With a profile file the call makes it the document's output intent, creating one if needed; without one it uses the document's own output intent and reports the conversion as blocked when there is none
The call marks the output intent as the PDF/X one, removes scripts and the action that runs them, embeds fonts that are not embedded from the installed fonts, gives every page without a trim box or art box a trim box matching its visible area, and states that the document has not been trapped when it does not say. For PDF/X-3 and later it adds a DefaultRGB space so device RGB is colour-managed as sRGB, which those parts accept
It then claims the part, writes the document and checks what came out; the verdict comes from the check. Colour is not converted to CMYK and transparency is not flattened, so a PDF/X-1a target with RGB or transparent content is reported rather than repaired
Example
PDF.LoadFromFile('brochure.pdf', '');
if PDF.ConvertToPDFX(3, 'CoatedFOGRA39.icc') = 1 then // PDF/X-4
PDF.SaveToFile('brochure-x4.pdf')
else
ShowMessage(PDF.GetPDFXConversionReport);See also
GetPDFXConversionReport, SetPDFXMode, ConvertToPDFA, CheckFileCompliance