From 98e5314e85034fbfd3cd5346cd27a404379dfcf8 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Thu, 27 Aug 2026 11:47:03 +0200 Subject: [PATCH] Keep the whole of a form when a plan is built, and open a file in time ops v0.4.0 -> v0.6.0, reader v0.4.0 -> v0.4.2, pdffont -> v0.3.0 indirect. A plan becomes a file through Plan.Build, and the ops release underneath it used to keep a form's widgets while throwing away the field list that gives them meaning: half a form, which is worse than none, because the boxes are still on the page and nothing knows what they are. The same release keeps what a document says about itself -- its language, and the flag saying it was marked up for a screen reader. reader v0.4.2 brings two fixes with it. It walks the objects a file has rather than every number up to the largest of them: a 219-byte file naming object 2 147 483 647 took 21.2 s to open and allocated nothing, so no memory limit caught it. And InlineImage.Expanded no longer lets Go's randomised map iteration order decide between both spellings of a key -- /W beside /Width -- which a page carried through a plan inherits. pdffont is raised with them because it is compiled into this package through ops and forms, and v0.3.0 is where a 10 655-byte /ToUnicode map stops producing 13 million entries and 1 054 MB. --- go.mod | 11 +++++++++-- go.sum | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 545a97a..cb27770 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,13 @@ go 1.26.4 require ( github.com/go-crdt/crdt v0.31.0 github.com/go-deltasync/chunk v0.2.0 - github.com/go-pdfkit/ops v0.4.0 - github.com/go-pdfkit/reader v0.4.0 + github.com/go-pdfkit/ops v0.6.0 + github.com/go-pdfkit/reader v0.4.2 +) + +require ( + github.com/go-opentype/fonts v0.9.0 // indirect + github.com/go-opentype/opentype v0.9.0 // indirect + github.com/go-pdfkit/forms v0.2.1 // indirect + github.com/go-pdfkit/pdffont v0.3.0 // indirect ) diff --git a/go.sum b/go.sum index 868d190..427e202 100644 --- a/go.sum +++ b/go.sum @@ -2,7 +2,15 @@ github.com/go-crdt/crdt v0.31.0 h1:CTi+lo0bjsJv3F09CR/AdILQtWEWmzbDQ+S/6HNBOMU= github.com/go-crdt/crdt v0.31.0/go.mod h1:vbfvns9B9FUaMi2sPKzMYttKmbxfgO7EK3Yu82SrlYw= github.com/go-deltasync/chunk v0.2.0 h1:2w4zBBXbrZwsBJAMnBCstPTj4YNeUvHjvY0qAFA1yuE= github.com/go-deltasync/chunk v0.2.0/go.mod h1:lstvS05YsLMRBKrvE75vOXm07cMMRVQJfhdYPiR04OE= -github.com/go-pdfkit/ops v0.4.0 h1:2WeYwDhN2OyoYtjYCdgm7gWGVNmiu+8OwOKEhyb3Cp0= -github.com/go-pdfkit/ops v0.4.0/go.mod h1:X89phxHICCYl6+zn3L6YXH3mRLBlsLdPYuDCryGLXzI= -github.com/go-pdfkit/reader v0.4.0 h1:qPbNZSO+Xl+4NBvQoV1PYt7HlqHaEAQ1tUc6/IL8JAU= -github.com/go-pdfkit/reader v0.4.0/go.mod h1:fQFOVfCMUui1AdvD4qhimdyvvNr9KvvJ1S7IuKZjyV8= +github.com/go-opentype/fonts v0.9.0 h1:slB6OB3riLyUPrOxqXe0s6/AzdenF1TDvCN8N87hhQk= +github.com/go-opentype/fonts v0.9.0/go.mod h1:C6yQL2apHItfEZ5hztpsHF0S5mlX/hklLlq/Z5fRG/g= +github.com/go-opentype/opentype v0.9.0 h1:GFgcJ3nwTDp4NJr5O+Paw7lhZx5Jv/R+noZwvhYDlkM= +github.com/go-opentype/opentype v0.9.0/go.mod h1:AOixevJf7XQaH7+WG+OMIOZEbYPXfMqklVk26Y6YTUU= +github.com/go-pdfkit/forms v0.2.1 h1:INa2GwAadxEhcXvBe7zJYgapYwaGn9WIaLxUJU/lm6A= +github.com/go-pdfkit/forms v0.2.1/go.mod h1:LORxkdP4FVULFk0/PA0CdPZc1dZF9zTSaHrtfM7IYaw= +github.com/go-pdfkit/ops v0.6.0 h1:5C8qLzdUosBPmdGbC0YOuObCv9OSTLkl1ZatyzeBAik= +github.com/go-pdfkit/ops v0.6.0/go.mod h1:Is3FBR2NcCUEzNt4eowdsVa+P0SBtGtcxK8lDlOeyrk= +github.com/go-pdfkit/pdffont v0.3.0 h1:G5DKcAmsZJ0e17QhSrcUaL7PKEXKjUx4P/iGMl7bAbI= +github.com/go-pdfkit/pdffont v0.3.0/go.mod h1:bfmNLna1l1CljNX/Utg55YzFylovfmI7sJnvgA3bzKI= +github.com/go-pdfkit/reader v0.4.2 h1:0/qPShLzdG/roH4i13dwDTHnS7mEBVTaCBGwCZQhOH0= +github.com/go-pdfkit/reader v0.4.2/go.mod h1:fQFOVfCMUui1AdvD4qhimdyvvNr9KvvJ1S7IuKZjyV8=