Skip to content

Commit

Permalink
Save work on markdown formatting example code.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Dec 10, 2024
1 parent 7a45adb commit 5a4afad
Show file tree
Hide file tree
Showing 11 changed files with 3,105 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.1.dylib
*.a
*.dSYM
*.log
*.o
*.so.1
Expand All @@ -11,6 +12,7 @@
/configure~
/doc/pdfio.epub
/examples/code128
/examples/md2pdf
/Makefile
/packages
/pdfio.pc
Expand Down
7 changes: 7 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ code128.c
---------

This example shows how to embed and use a barcode font.


md2pdf.c
--------

This example shows how to generate pages with multiple fonts, embedded images,
and headers and footers.
46 changes: 46 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Makefile for PDFio examples.
#
# Copyright © 2024 by Michael R Sweet.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#

# POSIX makefile
.POSIX:


# Common options
CFLAGS = -g $(CPPFLAGS)
CPPFLAGS = -I..
LIBS = -L.. -lpdfio -lz


# Targets
TARGETS = \
code128 \
md2pdf


# Make everything
all: $(TARGETS)


# Clean everything
clean:
rm -f $(TARGETS)


# code128
code128: code128.c
$(CC) $(CFLAGS) -o $@ code128.c $(LIBS)


# md2pdf
md2pdf: md2pdf.c mmd.c mmd.h
$(CC) $(CFLAGS) -o $@ md2pdf.c mmd.c $(LIBS)


# Common dependencies...
$(TARGETS): Makefile ../pdfio.h ../pdfio-content.h
Binary file added examples/Roboto-Bold.ttf
Binary file not shown.
Binary file added examples/Roboto-Italic.ttf
Binary file not shown.
Binary file added examples/Roboto-Regular.ttf
Binary file not shown.
Binary file added examples/RobotoMono-Regular.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/code128.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ make_code128(char *dst, // I - Destination buffer
{
char *dstptr, // Pointer into destination buffer
*dstend; // End of destination buffer
int sum = 0; // Weighted sum
int sum; // Weighted sum
static const char *code128_chars = // Code 128 characters
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
Expand Down
Loading

0 comments on commit 5a4afad

Please sign in to comment.