Ensure content streams are not compressed in optimization test

This commit is contained in:
Gunnsteinn Hall 2018-10-13 16:24:04 +00:00
parent 0879fa1b1a
commit 4a4c73ba0b

View File

@ -2724,7 +2724,7 @@ func TestCompressStreams(t *testing.T) {
// Need to add Arial to the page resources to avoid generating invalid PDF (avoid build fail).
times := model.NewStandard14FontMustCompile(model.TimesRoman)
page.Resources.SetFontByName("Times", times.ToPdfObject())
page.AddContentStreamByString(`BT
rawContent := `BT
/Times 56 Tf
20 600 Td
(The multiline example text)Tj
@ -2739,7 +2739,17 @@ func TestCompressStreams(t *testing.T) {
(example text)'
(example text)'
(example text)'
ET`)
ET`
{
cstreams, err := page.GetContentStreams()
if err != nil {
panic(err)
}
cstreams = append(cstreams, rawContent)
// Set streams with raw encoder (not encoded).
page.SetContentStreams(cstreams, core.NewRawEncoder())
}
return c
}