From b06975647cc7a8f1c913ba01d744bba0ed45cbbb Mon Sep 17 00:00:00 2001 From: Jeroen Bobbeldijk Date: Sun, 10 Sep 2017 17:37:42 +0200 Subject: [PATCH] Fix Index --- sign/pdfxref.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sign/pdfxref.go b/sign/pdfxref.go index 3df8f38..f64120c 100644 --- a/sign/pdfxref.go +++ b/sign/pdfxref.go @@ -130,7 +130,7 @@ func (context *SignContext) writeXrefStream() error { id1 := hex.EncodeToString([]byte(id.Index(0).RawString())) new_xref := strconv.Itoa(int(context.SignData.ObjectId + 1)) + " 0 obj\n" - new_xref += "<< /Type /XRef /Length " + strconv.Itoa(len(streamBytes.Bytes())) + " /Filter /FlateDecode /DecodeParms << /Columns 5 /Predictor 12 >> /W [ 1 3 1 ] /Prev " + strconv.FormatInt(context.PDFReader.XrefInformation.StartPos, 10) + " /Size " + strconv.FormatInt(context.PDFReader.XrefInformation.ItemCount+5, 10) + " /Index [ 5 " + strconv.FormatInt(context.PDFReader.XrefInformation.ItemCount, 10) + " ] /" + new_info + " /" + new_root + " /ID [<" + id0 + "><" + id1 + ">] >>\n" + new_xref += "<< /Type /XRef /Length " + strconv.Itoa(len(streamBytes.Bytes())) + " /Filter /FlateDecode /DecodeParms << /Columns 5 /Predictor 12 >> /W [ 1 3 1 ] /Prev " + strconv.FormatInt(context.PDFReader.XrefInformation.StartPos, 10) + " /Size " + strconv.FormatInt(context.PDFReader.XrefInformation.ItemCount+5, 10) + " /Index [ " + strconv.FormatInt(context.PDFReader.XrefInformation.ItemCount, 10) + " 5 ] /" + new_info + " /" + new_root + " /ID [<" + id0 + "><" + id1 + ">] >>\n" if _, err := context.OutputFile.Write([]byte(new_xref)); err != nil { return err }