mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-02-26 22:02:49 +01:00
Update documentation and examples makefile.
This commit is contained in:
parent
e96f9bfa6b
commit
6d65a609e5
@ -1,4 +1,4 @@
|
||||
.TH pdfio 3 "pdf read/write library" "2024-12-22" "pdf read/write library"
|
||||
.TH pdfio 3 "pdf read/write library" "2024-12-26" "pdf read/write library"
|
||||
.SH NAME
|
||||
pdfio \- pdf read/write library
|
||||
.SH Introduction
|
||||
@ -1028,6 +1028,8 @@ pdfioContentTextShowJustified draws an array of literal strings with offsets bet
|
||||
|
||||
|
||||
.SH Examples
|
||||
.PP
|
||||
PDFio includes several example programs that are typically installed to the /usr/share/doc/pdfio/examples or /usr/local/share/doc/pdfio/examples directories. A makefile is included to build them.
|
||||
.SS Read PDF Metadata
|
||||
.PP
|
||||
The pdfioinfo.c example program opens a PDF file and prints the title, author, creation date, and number of pages:
|
||||
@ -2068,13 +2070,13 @@ We then loops through the fragments for the current line, drawing checkboxes, im
|
||||
doclink_t *l = dd\->links + dd\->num_links;
|
||||
// Pointer to this link record
|
||||
|
||||
if (!strcmp(frag\->url, "@"))
|
||||
if (!strcmp(frag\->url, "@"))
|
||||
{
|
||||
// Use mapped text as link target...
|
||||
char targetlink[129]; // Targeted link
|
||||
|
||||
targetlink[0] = '#';
|
||||
make_target_name(targetlink + 1, frag\->text, sNzeof(targetlink) \- 1);
|
||||
make_target_name(targetlink + 1, frag\->text, sizeof(targetlink) \- 1);
|
||||
|
||||
l\->url = pdfioStringCreate(dd\->pdf, targetlink);
|
||||
}
|
||||
|
@ -1148,6 +1148,7 @@ pdfio_obj_t *img =
|
||||
</li>
|
||||
</ul>
|
||||
<h2 class="title" id="examples">Examples</h2>
|
||||
<p>PDFio includes several example programs that are typically installed to the <code>/usr/share/doc/pdfio/examples</code> or <code>/usr/local/share/doc/pdfio/examples</code> directories. A makefile is included to build them.</p>
|
||||
<h3 class="title" id="read-pdf-metadata">Read PDF Metadata</h3>
|
||||
<p>The <code>pdfioinfo.c</code> example program opens a PDF file and prints the title, author, creation date, and number of pages:</p>
|
||||
<pre><code class="language-c"><span class="directive">#include <pdfio.h></span>
|
||||
@ -2027,13 +2028,13 @@ dd->y -= margin_top + lineheight;
|
||||
doclink_t *l = dd->links + dd->num_links;
|
||||
<span class="comment">// Pointer to this link record</span>
|
||||
|
||||
<span class="reserved">if</span> (!strcmp(frag->url, <span class="string">"@"</span>))
|
||||
ï<span class="reserved">if</span> (!strcmp(frag->url, <span class="string">"@"</span>))
|
||||
{
|
||||
<span class="comment">// Use mapped text as link target...</span>
|
||||
<span class="reserved">char</span> targetlink[<span class="number">129</span>]; <span class="comment">// Targeted link</span>
|
||||
|
||||
targetlink[<span class="number">0</span>] = <span class="string">'#'</span>;
|
||||
make_target_name(targetlink + <span class="number">1</span>, frag->text, s¾zeof(targetlink) - <span class="number">1</span>);
|
||||
make_target_name(targetlink + <span class="number">1</span>, frag->text, <span class="reserved">sizeof</span>(targetlink) - <span class="number">1</span>);
|
||||
|
||||
l->url = pdfioStringCreate(dd->pdf, targetlink);
|
||||
}
|
||||
|
@ -864,6 +864,10 @@ escaping, as needed:
|
||||
Examples
|
||||
========
|
||||
|
||||
PDFio includes several example programs that are typically installed to the
|
||||
`/usr/share/doc/pdfio/examples` or `/usr/local/share/doc/pdfio/examples`
|
||||
directories. A makefile is included to build them.
|
||||
|
||||
|
||||
Read PDF Metadata
|
||||
-----------------
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
|
||||
# Common options
|
||||
#CFLAGS = -g $(CPPFLAGS)
|
||||
CFLAGS = -g -fsanitize=address $(CPPFLAGS)
|
||||
CPPFLAGS = -I..
|
||||
LIBS = -L.. -lpdfio -lz
|
||||
CFLAGS = -g $(CPPFLAGS)
|
||||
#CFLAGS = -g -fsanitize=address $(CPPFLAGS)
|
||||
CPPFLAGS = -I.. -I/usr/local/include
|
||||
LIBS = -L.. -L/usr/local/lib -lpdfio -lz
|
||||
|
||||
|
||||
# Targets
|
||||
|
Loading…
x
Reference in New Issue
Block a user