mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-26 13:28:22 +01:00
Prep for 1.0rc1.
This commit is contained in:
parent
b0bf2e04b9
commit
9d47745e43
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)
|
error_cb(pdfio_file_t *pdf, const char *message, void *data)
|
||||||
{
|
{
|
||||||
(void)data; // This callback does not use the data pointer
|
(void)data; // This callback does not use the data pointer
|
||||||
|
|
||||||
fprintf(stderr, "%s: %s\\n", pdfioFileGetName(pdf), message);
|
fprintf(stderr, "%s: %s\\n", pdfioFileGetName(pdf), message);
|
||||||
|
|
||||||
// Return false to treat warnings as errors
|
// Return false to treat warnings as errors
|
||||||
return (false);
|
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 i; // Looping var
|
||||||
size_t count; // Number of pages
|
size_t count; // Number of pages
|
||||||
pdfio_obj_t *page; // Current page
|
pdfio_obj_t *page; // Current page
|
||||||
|
|
||||||
// Iterate the pages in the PDF file
|
// Iterate the pages in the PDF file
|
||||||
for (i = 0, count = pdfioFileGetNumPages(pdf); i < count; i ++)
|
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 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_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);
|
pdfio_file_t *pdf = pdfioFileCreate("myoutputfile.pdf", "2.0", &media_box, &crop_box, error_cb, error_data);
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.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 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_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);
|
pdfio_file_t *pdf = pdfioFileCreateOutput(output_cb, output_ctx, "2.0", &media_box, &crop_box, error_cb, error_data);
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
@ -444,13 +444,13 @@ PDFio also includes predefined constants for creating a few standard color space
|
|||||||
.nf
|
.nf
|
||||||
|
|
||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
|
|
||||||
// Create an AdobeRGB color array
|
// Create an AdobeRGB color array
|
||||||
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_ADOBE);
|
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_ADOBE);
|
||||||
|
|
||||||
// Create an Display P3 color array
|
// Create an Display P3 color array
|
||||||
pdfio_array_t *display_p3 = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_P3_D65);
|
pdfio_array_t *display_p3 = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_P3_D65);
|
||||||
|
|
||||||
// Create an sRGB color array
|
// Create an sRGB color array
|
||||||
pdfio_array_t *srgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_SRGB);
|
pdfio_array_t *srgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_SRGB);
|
||||||
.fi
|
.fi
|
||||||
@ -550,10 +550,10 @@ will create an object for a 1024x1024 RGBA image in memory, using the default co
|
|||||||
.nf
|
.nf
|
||||||
|
|
||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
|
|
||||||
// Create an AdobeRGB color array
|
// Create an AdobeRGB color array
|
||||||
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromMatrix(pdf, 3, pdfioAdobeRGBGamma, pdfioAdobeRGBMatrix, pdfioAdobeRGBWhitePoint);
|
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromMatrix(pdf, 3, pdfioAdobeRGBGamma, pdfioAdobeRGBMatrix, pdfioAdobeRGBWhitePoint);
|
||||||
|
|
||||||
// Create a 1024x1024 RGBA image using AdobeRGB
|
// Create a 1024x1024 RGBA image using AdobeRGB
|
||||||
unsigned char data[1024 * 1024 * 4]; // 1024x1024 RGBA image data
|
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);
|
pdfio_obj_t *img = pdfioFileCreateImageObjFromData(pdf, data, /*width*/1024, /*height*/1024, /*num_colors*/3, /*color_data*/adobe_rgb, /*alpha*/true, /*interpolate*/false);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en-US">
|
<html lang="en-US">
|
||||||
<head>
|
<head>
|
||||||
<title>PDFio Programming Manual v1.0.0</title>
|
<title>PDFio Programming Manual v1.0rc1</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
<meta name="generator" content="codedoc v3.7">
|
<meta name="generator" content="codedoc v3.7">
|
||||||
<meta name="author" content="Michael R Sweet">
|
<meta name="author" content="Michael R Sweet">
|
||||||
<meta name="language" content="en-US">
|
<meta name="language" content="en-US">
|
||||||
<meta name="copyright" content="Copyright © 2021 by Michael R Sweet">
|
<meta name="copyright" content="Copyright © 2021 by Michael R Sweet">
|
||||||
<meta name="version" content="1.0.0">
|
<meta name="version" content="1.0rc1">
|
||||||
<style type="text/css"><!--
|
<style type="text/css"><!--
|
||||||
body {
|
body {
|
||||||
background: white;
|
background: white;
|
||||||
@ -245,7 +245,7 @@ span.string {
|
|||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<p><img class="title" src="pdfio-512.png"></p>
|
<p><img class="title" src="pdfio-512.png"></p>
|
||||||
<h1 class="title">PDFio Programming Manual v1.0.0</h1>
|
<h1 class="title">PDFio Programming Manual v1.0rc1</h1>
|
||||||
<p>Michael R Sweet</p>
|
<p>Michael R Sweet</p>
|
||||||
<p>Copyright © 2021 by Michael R Sweet</p>
|
<p>Copyright © 2021 by Michael R Sweet</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user