17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

setcolor:iccprofilegray, setcolor:iccprofilergb, setcolor:iccprofilecmyk parameters. Subsequently<br />

ICC-based color values can be supplied to setcolor( ) along with one of the color<br />

space keywords iccbasedgray, iccbasedrgb, or iccbasedcmyk:<br />

p.set_parameter("errorpolicy", "return");<br />

icchandle = p.load_iccprofile(...);<br />

if (icchandle == -1)<br />

{<br />

return;<br />

}<br />

p.set_value("setcolor:iccprofilecmyk", icchandle);<br />

p.setcolor("fill", "iccbasedcmyk", 0, 1, 0, 0);<br />

Mapping device colors to ICC-based default color spaces. PDF provides a feature for<br />

mapping device-dependent gray, RGB, or CMYK colors in a page description to deviceindependent<br />

colors. This can be used to attach a precise colorimetric specification to<br />

color values which otherwise would be device-dependent. Mapping color values this<br />

way is accomplished by supplying a DefaultGray, DefaultRGB, or DefaultCMYK color<br />

space definition. In <strong>PDFlib</strong> it can be achieved by setting the defaultgray, defaultrgb, or<br />

defaultcmyk options of begin_page_ext( ) and supplying an ICC profile handle as the corresponding<br />

value. The following examples will set the sRGB color space as the default<br />

RGB color space for text, images, and vector graphics:<br />

/* sRGB is guaranteed to be always available */<br />

icchandle = p.load_iccprofile("sRGB", "usage=iccbased");<br />

p.begin_page_ext(595, 842, "defaultrgb=" + icchandle);<br />

Defining output intents for PDF/X and PDF/A. An output device (printer) profile can<br />

be used to specify an output condition for PDF/X. This is done by supplying<br />

usage=outputintent in the call to load_iccprofile( ). For PDF/A any kind of profile can be<br />

specified as output intent. For details see Section 10.3, »PDF/X for Print Production«,<br />

page 253, and Section 10.4, »PDF/A for Archiving«, page 260.<br />

86 Chapter 3: Creating PDF Documents (Edition for <strong>COM</strong>, .<strong>NET</strong>, and REALbasic)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!