Fix PDF 1.7 with XRef Stream causes panic #61

This commit is contained in:
Paul van Brouwershaven
2025-02-25 18:13:10 +01:00
parent 1fb39a3ce9
commit 681997c680
4 changed files with 159 additions and 76 deletions

View File

@@ -49,6 +49,10 @@ func (context *SignContext) writeTrailer() error {
if _, err := context.OutputBuffer.Write([]byte(trailer_string)); err != nil {
return err
}
} else if context.PDFReader.XrefInformation.Type == "stream" {
if _, err := context.OutputBuffer.Write([]byte("startxref\n")); err != nil {
return err
}
}
// Write the new xref start position.