diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-03-29 22:25:09 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-04-24 16:47:43 +0200 |
commit | 51b8205a513e86c62121a927a067632c1a933839 (patch) | |
tree | c2882a6c253a715bfc2ea72854c75350f0b2024b /source/tools/pdfmerge.c | |
parent | 67a7449fc1f186f318942b9c6b8d66d4458b7d87 (diff) | |
download | mupdf-51b8205a513e86c62121a927a067632c1a933839.tar.xz |
Remove need for namedump by using macros and preprocessor.
Add a PDF_NAME(Foo) macro that evaluates to a pdf_obj for /Foo.
Use the C preprocessor to create the enum values and string table
from one include file instead of using a separate code generator tool.
Diffstat (limited to 'source/tools/pdfmerge.c')
-rw-r--r-- | source/tools/pdfmerge.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/tools/pdfmerge.c b/source/tools/pdfmerge.c index 86e8a27b..f0d124d8 100644 --- a/source/tools/pdfmerge.c +++ b/source/tools/pdfmerge.c @@ -36,9 +36,9 @@ static void page_merge(int page_from, int page_to, pdf_graft_map *graft_map) int i; /* Copy as few key/value pairs as we can. Do not include items that reference other pages. */ - static pdf_obj * const copy_list[] = { PDF_NAME_Contents, PDF_NAME_Resources, - PDF_NAME_MediaBox, PDF_NAME_CropBox, PDF_NAME_BleedBox, PDF_NAME_TrimBox, PDF_NAME_ArtBox, - PDF_NAME_Rotate, PDF_NAME_UserUnit }; + static pdf_obj * const copy_list[] = { PDF_NAME(Contents), PDF_NAME(Resources), + PDF_NAME(MediaBox), PDF_NAME(CropBox), PDF_NAME(BleedBox), PDF_NAME(TrimBox), PDF_NAME(ArtBox), + PDF_NAME(Rotate), PDF_NAME(UserUnit) }; fz_var(ref); @@ -50,7 +50,7 @@ static void page_merge(int page_from, int page_to, pdf_graft_map *graft_map) /* Make a new page object dictionary to hold the items we copy from the source page. */ page_dict = pdf_new_dict(ctx, doc_des, 4); - pdf_dict_put(ctx, page_dict, PDF_NAME_Type, PDF_NAME_Page); + pdf_dict_put(ctx, page_dict, PDF_NAME(Type), PDF_NAME(Page)); for (i = 0; i < nelem(copy_list); i++) { |