Skip to content
Permalink
Browse files

Fix #85

  • Loading branch information...
hhrutter committed Jun 2, 2019
1 parent f9a4092 commit 33da2ddb3686ab98567f1abefbc62e8d15ed2720
Showing with 22 additions and 1 deletion.
  1. +21 −0 pkg/api/process_test.go
  2. +1 −1 pkg/pdfcpu/read.go
@@ -25,6 +25,7 @@ import (
"strings"
"testing"

PDFCPULog "github.com/hhrutter/pdfcpu/pkg/log"
pdf "github.com/hhrutter/pdfcpu/pkg/pdfcpu"
"github.com/hhrutter/pdfcpu/pkg/pdfcpu/validate"
)
@@ -1824,3 +1825,23 @@ func TestAcroformDemoPDF(t *testing.T) {
}

}

// Enable this test for debugging of a specicif file.
func XTestValidateCommand(t *testing.T) {

PDFCPULog.SetDefaultTraceLogger()
//PDFCPULog.SetDefaultParseLogger()
PDFCPULog.SetDefaultReadLogger()
PDFCPULog.SetDefaultValidateLogger()
PDFCPULog.SetDefaultOptimizeLogger()
PDFCPULog.SetDefaultWriteLogger()

config := pdf.NewDefaultConfiguration()
config.ValidationMode = pdf.ValidationRelaxed

_, err := Process(ValidateCommand("testdata/test.pdf", config))
if err != nil {
t.Fatalf("TestValidateCommand: %v\n", err)
}

}
@@ -1063,7 +1063,7 @@ func buildXRefTableStartingAt(ctx *Context, offset *int64) error {

log.Read.Printf("line: <%s>\n", line)

if line != "xref" {
if strings.TrimSpace(line) != "xref" {

log.Read.Println("buildXRefTableStartingAt: found xref stream")
ctx.Read.UsingXRefStreams = true

0 comments on commit 33da2dd

Please sign in to comment.
You can’t perform that action at this time.