From 45899f8a8d08bea726e65ba81ffc3a57e76242cb Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 16 May 2021 18:31:45 -0400 Subject: [PATCH] Default CropBox should be the full MediaBox. --- TODO.md | 15 ++++----------- pdfio-file.c | 8 +++----- testpdfio.c | 4 ++-- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/TODO.md b/TODO.md index b668cb8..ac1200b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,17 +1,10 @@ To-Do List ========== -- All of the object write code -- All of the stream write code -- Page create method -- Write out trailer -- How to handle object references between documents, i.e., if I copy a page from - one PDF to another, there are a bunch of resources that also need to be - copied. A dictionary with an object reference can't be copied directly as the - object number in the new PDF will likely be different than the old one. - - Add _pdfio_map_t with original pdfio_file_t * and object numbers - - Add _pdfioObjCopy function - - Add _pdfioFileGetMappedObject function to get the new object number +- Resources: + - Fonts + - ICC profiles/standard color spaces + - Others? - Security handlers (RC4 + AES, MD5 + SHA-256) for reading encrypted documents. - Signature generation/validation code - Documentation diff --git a/pdfio-file.c b/pdfio-file.c index 1051824..dd9a1ad 100644 --- a/pdfio-file.c +++ b/pdfio-file.c @@ -198,11 +198,9 @@ pdfioFileCreate( } else { - // Default to "universal" size (intersection of A4 and US Letter) with 1/4" margins - pdf->crop_box.x1 = 18.0f; - pdf->crop_box.y1 = 18.0f; - pdf->crop_box.x2 = 210.0f * 72.0f / 25.4f - 18.0f; - pdf->crop_box.y2 = 11.0f * 72.0f - 18.0f; + // Default to "universal" size (intersection of A4 and US Letter) + pdf->crop_box.x2 = 210.0f * 72.0f / 25.4f; + pdf->crop_box.y2 = 11.0f * 72.0f; } // Create the file... diff --git a/testpdfio.c b/testpdfio.c index 9c157a3..d9d7454 100644 --- a/testpdfio.c +++ b/testpdfio.c @@ -313,8 +313,8 @@ write_page(pdfio_file_t *pdf, // I - PDF file fputs("pdfioStreamPuts(...): ", stdout); if (pdfioStreamPuts(st, - "0 g 18 18 559 760 re 72 72 451 648 re f*\n" - "1 0 0 RG 18 18 559 760 re 72 72 451 648 re S\n")) + "1 0 0 RG 0 g 5 w\n" + "18 18 559 760 re 72 72 451 648 re B*\n")) puts("PASS"); else return (1);