mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-08-29 15:22:06 +02:00
Prep for 1.0rc1.
This commit is contained in:
20
doc/pdfio.3
20
doc/pdfio.3
@@ -228,9 +228,9 @@ where the three arguments to the function are the filename ("myinputfile.pdf"),
|
||||
error_cb(pdfio_file_t *pdf, const char *message, void *data)
|
||||
{
|
||||
(void)data; // This callback does not use the data pointer
|
||||
|
||||
|
||||
fprintf(stderr, "%s: %s\\n", pdfioFileGetName(pdf), message);
|
||||
|
||||
|
||||
// Return false to treat warnings as errors
|
||||
return (false);
|
||||
}
|
||||
@@ -245,7 +245,7 @@ Each PDF file contains one or more pages. The pdfioFileGetNumPages function retu
|
||||
size_t i; // Looping var
|
||||
size_t count; // Number of pages
|
||||
pdfio_obj_t *page; // Current page
|
||||
|
||||
|
||||
// Iterate the pages in the PDF file
|
||||
for (i = 0, count = pdfioFileGetNumPages(pdf); i < count; i ++)
|
||||
{
|
||||
@@ -268,7 +268,7 @@ You create a new PDF file using the pdfioFileCreate function:
|
||||
|
||||
pdfio_rect_t media_box = { 0.0, 0.0, 612.0, 792.0 }; // US Letter
|
||||
pdfio_rect_t crop_box = { 36.0, 36.0, 576.0, 756.0 }; // w/0.5" margins
|
||||
|
||||
|
||||
pdfio_file_t *pdf = pdfioFileCreate("myoutputfile.pdf", "2.0", &media_box, &crop_box, error_cb, error_data);
|
||||
.fi
|
||||
.PP
|
||||
@@ -279,7 +279,7 @@ Alternately you can stream a PDF file using the pdfioFileCreateOutput function:
|
||||
|
||||
pdfio_rect_t media_box = { 0.0, 0.0, 612.0, 792.0 }; // US Letter
|
||||
pdfio_rect_t crop_box = { 36.0, 36.0, 576.0, 756.0 }; // w/0.5" margins
|
||||
|
||||
|
||||
pdfio_file_t *pdf = pdfioFileCreateOutput(output_cb, output_ctx, "2.0", &media_box, &crop_box, error_cb, error_data);
|
||||
.fi
|
||||
.PP
|
||||
@@ -444,13 +444,13 @@ PDFio also includes predefined constants for creating a few standard color space
|
||||
.nf
|
||||
|
||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||
|
||||
|
||||
// Create an AdobeRGB color array
|
||||
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_ADOBE);
|
||||
|
||||
|
||||
// Create an Display P3 color array
|
||||
pdfio_array_t *display_p3 = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_P3_D65);
|
||||
|
||||
|
||||
// Create an sRGB color array
|
||||
pdfio_array_t *srgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_SRGB);
|
||||
.fi
|
||||
@@ -550,10 +550,10 @@ will create an object for a 1024x1024 RGBA image in memory, using the default co
|
||||
.nf
|
||||
|
||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||
|
||||
|
||||
// Create an AdobeRGB color array
|
||||
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromMatrix(pdf, 3, pdfioAdobeRGBGamma, pdfioAdobeRGBMatrix, pdfioAdobeRGBWhitePoint);
|
||||
|
||||
|
||||
// Create a 1024x1024 RGBA image using AdobeRGB
|
||||
unsigned char data[1024 * 1024 * 4]; // 1024x1024 RGBA image data
|
||||
pdfio_obj_t *img = pdfioFileCreateImageObjFromData(pdf, data, /*width*/1024, /*height*/1024, /*num_colors*/3, /*color_data*/adobe_rgb, /*alpha*/true, /*interpolate*/false);
|
||||
|
Reference in New Issue
Block a user