Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B-22137 & B-22170 update pdfcpu 0.6.0 to latest 0.9.1 #14496

Merged
merged 61 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2ed0d85
update pdfcpu 0.6.0 to latest 0.9.1
cameroncaci Dec 31, 2024
1edce68
adjust pdfcpu tests
cameroncaci Dec 31, 2024
94e70d5
add missing err checks
cameroncaci Dec 31, 2024
3d858d6
configure generator to configure font dir manually
cameroncaci Jan 8, 2025
be26b4c
set roboto regular in memory instead of file system
cameroncaci Jan 8, 2025
8f10db5
revert custom config setup to pdfcpu default
cameroncaci Jan 8, 2025
0c9e810
configure generator to configure font dir manually
cameroncaci Jan 8, 2025
47aa842
set roboto regular in memory instead of file system
cameroncaci Jan 8, 2025
266653c
revert custom config setup to pdfcpu default
cameroncaci Jan 8, 2025
4d050e8
deploy to exp
cameroncaci Jan 8, 2025
4f01ac3
watermark enhancement, cleanup, and deprecation
cameroncaci Jan 8, 2025
0faa074
Revert "deploy to exp"
cameroncaci Jan 8, 2025
49d62b4
deploy to exp again
cameroncaci Jan 9, 2025
fa1eea5
attempt setting pdfcpu config in repo
cameroncaci Jan 9, 2025
621e831
set config path for pdfcpu
cameroncaci Jan 10, 2025
ae8e15e
self hosted err check
cameroncaci Jan 10, 2025
5384b91
persist pdfcpu config to ecs container
cameroncaci Jan 10, 2025
c31bc09
switched pdfcpu config to be embedded
cameroncaci Jan 10, 2025
f72e4c0
disable config
cameroncaci Jan 13, 2025
004d3bb
remove fonts
cameroncaci Jan 13, 2025
b0464b1
Revert "deploy to exp again"
cameroncaci Jan 13, 2025
b4cfcde
typo fix
cameroncaci Jan 13, 2025
cdb3f5d
Revert "disable config"
cameroncaci Jan 13, 2025
62a06b7
point config to temp dir for aws fargate
cameroncaci Jan 13, 2025
7f60b87
remove config again
cameroncaci Jan 13, 2025
6e55464
Reapply "deploy to exp again"
cameroncaci Jan 13, 2025
05f19ba
add ephemeral volume to app-client-tls
cameroncaci Jan 14, 2025
3a1b64b
tmp dir and ephemeral dir switch case in pdfcpu generator
cameroncaci Jan 14, 2025
533795e
add log to mutable check
cameroncaci Jan 14, 2025
82968bb
overload volume over tmp
cameroncaci Jan 14, 2025
9585136
grant full access to tmp ephemeral dir
cameroncaci Jan 14, 2025
ea6e48b
mount ephemeral storage to app as well
cameroncaci Jan 14, 2025
e5b3235
Revert "overload volume over tmp"
cameroncaci Jan 14, 2025
52771fc
point to new path
cameroncaci Jan 14, 2025
d4bf9d3
switch from ephemeral storage to tmpfs memory use
cameroncaci Jan 15, 2025
3669548
fix typo
cameroncaci Jan 15, 2025
ec76440
configure ephemeral perms in build step of docker
cameroncaci Jan 15, 2025
1221bba
Revert "fix typo"
cameroncaci Jan 15, 2025
dfaffa5
Revert "switch from ephemeral storage to tmpfs memory use"
cameroncaci Jan 15, 2025
2dbba9d
remove this
cameroncaci Jan 15, 2025
c733fdc
copy from build env
cameroncaci Jan 15, 2025
ce8c589
test workdir
josiahzimmerman-caci Jan 15, 2025
af2d76c
test --chown=1042 from copy
josiahzimmerman-caci Jan 15, 2025
568cd26
test --chown=nonroot user from copy
josiahzimmerman-caci Jan 15, 2025
c132da8
test volume
josiahzimmerman-caci Jan 15, 2025
05b74ef
switch from user perms to full perms
cameroncaci Jan 15, 2025
f4202ca
change to demo
josiahzimmerman-caci Jan 15, 2025
752354b
change directory to dir
josiahzimmerman-caci Jan 15, 2025
3f319ba
test nonroot at copy
josiahzimmerman-caci Jan 15, 2025
9f9db9b
last attempt for the night unless it yields different results
josiahzimmerman-caci Jan 15, 2025
dfb470f
last attempt for the night unless it yields different results - just …
josiahzimmerman-caci Jan 16, 2025
2765d75
last attempt for the night unless it yields different results - just …
josiahzimmerman-caci Jan 16, 2025
95de300
some progress
josiahzimmerman-caci Jan 16, 2025
a73c39d
some progress
josiahzimmerman-caci Jan 16, 2025
f377713
ephemeral cleanup
cameroncaci Jan 16, 2025
8a702b5
Knew I shouldnt have deleted Josiahs code
cameroncaci Jan 16, 2025
33b6824
Revert "change to demo"
cameroncaci Jan 16, 2025
2af3665
Revert "Reapply "deploy to exp again""
cameroncaci Jan 16, 2025
f03b8b3
Merge remote-tracking branch 'origin/integrationTesting' into prod-fi…
cameroncaci Jan 16, 2025
26ea095
put back to integration
cameroncaci Jan 16, 2025
8d9d3da
comment cleanup
cameroncaci Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
cameroncaci marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ references:

# In addition, it's common practice to disable acceptance tests and
# ignore tests for dp3 deploys. See the branch settings below.
dp3-branch: &dp3-branch integrationTesting
dp3-branch: &dp3-branch placeholder_branch_name
# MUST BE ONE OF: loadtest, demo, exp.
# These are used to pull in env vars so the spelling matters!
dp3-env: &dp3-env loadtest
dp3-env: &dp3-env placeholder_env

# set integration-ignore-branch to the branch if you want to IGNORE
# integration tests, or `placeholder_branch_name` if you do want to
Expand All @@ -53,7 +53,7 @@ references:
# set integration-mtls-ignore-branch to the branch if you want to
# IGNORE mtls integration tests, or `placeholder_branch_name` if you
# do want to run them
integration-mtls-ignore-branch: &integration-mtls-ignore-branch integrationTesting
integration-mtls-ignore-branch: &integration-mtls-ignore-branch placeholder_branch_name

# set client-ignore-branch to the branch if you want to IGNORE
# client tests, or `placeholder_branch_name` if you do want to run
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ RUN apt-get update
RUN apt-get install -y ca-certificates --no-install-recommends
RUN update-ca-certificates

## Give full perms to tmp for the server to have a read/write location
RUN mkdir -p /tmp && chmod 777 /tmp

# hadolint ignore=DL3007
FROM gcr.io/distroless/base-debian11@sha256:ac69aa622ea5dcbca0803ca877d47d069f51bd4282d5c96977e0390d7d256455
COPY --from=build-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

# Pull in full perms tmp
COPY --from=build-env --chown=nonroot:nonroot /tmp /tmp

COPY bin/rds-ca-rsa4096-g1.pem /bin/rds-ca-rsa4096-g1.pem
COPY bin/rds-ca-2019-root.pem /bin/rds-ca-2019-root.pem
COPY bin/milmove /bin/milmove
Expand All @@ -23,6 +29,9 @@ COPY swagger/* /swagger/
COPY build /build
COPY public/static/react-file-viewer /public/static/react-file-viewer

# Keep the tmp!
VOLUME ["/tmp"]

ENTRYPOINT ["/bin/milmove"]

CMD ["serve", "--logging-level=debug"]
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile.dp3
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
FROM debian:stable AS build-env

## Give full perms to tmp for the server to have a read/write location
RUN mkdir -p /tmp && chmod 777 /tmp

# hadolint ignore=DL3007
FROM gcr.io/distroless/base-debian11@sha256:ac69aa622ea5dcbca0803ca877d47d069f51bd4282d5c96977e0390d7d256455

Expand All @@ -6,6 +11,9 @@ COPY bin/rds-ca-rsa4096-g1.pem /bin/rds-ca-rsa4096-g1.pem

COPY bin/milmove /bin/milmove

# Pull in full perms tmp
COPY --from=build-env --chown=nonroot:nonroot /tmp /tmp

# Demo Environment certs
COPY config/tls/api.demo.dp3.us.chain.der.p7b /config/tls/api.demo.dp3.us.chain.der.p7b
COPY config/tls/api.demo.dp3.us.crt /config/tls/api.demo.dp3.us.crt
Expand All @@ -27,6 +35,9 @@ COPY swagger/* /swagger/
COPY build /build
COPY public/static/react-file-viewer /public/static/react-file-viewer

# Keep the tmp!
VOLUME ["/tmp"]

ENTRYPOINT ["/bin/milmove"]

CMD ["serve", "--logging-level=debug"]
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ require (
github.com/lib/pq v1.10.9
github.com/markbates/goth v1.79.0
github.com/namsral/flag v1.7.4-pre
github.com/pdfcpu/pdfcpu v0.6.0
github.com/pdfcpu/pdfcpu v0.9.1
github.com/pkg/errors v0.9.1
github.com/pkg/sftp v1.13.7
github.com/pterm/pterm v0.12.79
Expand Down Expand Up @@ -222,7 +222,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/microcosm-cc/bluemonday v1.0.23 // indirect
Expand All @@ -237,7 +237,7 @@ require (
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/peterbourgon/diskv/v3 v3.0.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/fastuuid v1.2.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/zerolog v1.29.0 // indirect
Expand All @@ -259,7 +259,7 @@ require (
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/image v0.18.0 // indirect
golang.org/x/image v0.21.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
Expand Down Expand Up @@ -511,8 +511,8 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 h1:pSCLCl6joCFRnjpeojzOpEYs4q7Vditq8fySFG5ap3Y=
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pdfcpu/pdfcpu v0.6.0 h1:z4kARP5bcWa39TTYMcN/kjBnm7MvhTWjXgeYmkdAGMI=
github.com/pdfcpu/pdfcpu v0.6.0/go.mod h1:kmpD0rk8YnZj0l3qSeGBlAB+XszHUgNv//ORH/E7EYo=
github.com/pdfcpu/pdfcpu v0.9.1 h1:q8/KlBdHjkE7ZJU4ofhKG5Rjf7M6L324CVM6BMDySao=
github.com/pdfcpu/pdfcpu v0.9.1/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/peterbourgon/diskv/v3 v3.0.1 h1:x06SQA46+PKIUftmEujdwSEpIx8kR+M9eLYsUxeYveU=
Expand Down Expand Up @@ -547,8 +547,8 @@ github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTK
github.com/rickar/cal/v2 v2.1.13 h1:FENBPXxDPyL1OWGf9ZdpWGcEiGoSjt0UZED8VOxvK0c=
github.com/rickar/cal/v2 v2.1.13/go.mod h1:/fdlMcx7GjPlIBibMzOM9gMvDBsrK+mOtRXdTzUqV/A=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down Expand Up @@ -730,8 +730,8 @@ golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjs
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down
74 changes: 68 additions & 6 deletions pkg/paperwork/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package paperwork

import (
"bytes"
_ "embed"
"fmt"
"image"
"image/color"
"image/jpeg"
"image/png"
"io"
"log"
"os"
"path/filepath"
"strings"

Expand Down Expand Up @@ -92,16 +96,38 @@ func convertTo8BitPNG(in io.Reader, out io.Writer) error {
return nil
}

// Identifies if a filepath directory is mutable
// This is needed in order to write config and fonts to filesystem
// as the pdfcpu package hard-code requires it at this time
// for initial installation and for form filling
func isDirMutable(path string) bool {
testFile := filepath.Join(path, "tmp")
file, err := os.Create(testFile)
if err != nil {
log.Printf("isDirMutable: failed for %s: %v\n", path, err)
return false
}
file.Close()
os.Remove(testFile) // Cleanup the test file, it is mutable here
return true
}

// NewGenerator creates a new Generator.
func NewGenerator(uploader *uploader.Uploader) (*Generator, error) {
// Use in memory filesystem for generation. Purpose is to not write
// to hard disk due to restrictions in AWS storage. May need better long term solution.
afs := storage.NewMemory(storage.NewMemoryParams("", "")).FileSystem()

// Disable ConfiDir for AWS deployment purposes.
// PDFCPU will attempt to create temp dir using os.create(hard disk).This will prevent it.
api.DisableConfigDir()
pdfConfig := model.NewDefaultConfiguration()
tmpDir := os.TempDir()
if !isDirMutable(tmpDir) {
return nil, fmt.Errorf("tmp directory (%s) is not mutable, cannot configure default pdfcpu generator settings", tmpDir)
}
err := api.EnsureDefaultConfigAt(tmpDir)
if err != nil {
return nil, err
}

pdfConfig := api.LoadConfiguration() // As long as our config was set properly, this will load it and not create a new default config
pdfCPU := pdfCPUWrapper{Configuration: pdfConfig}

directory, err := afs.TempDir("", "generator")
Expand Down Expand Up @@ -699,7 +725,7 @@ func (g *Generator) FillPDFForm(jsonData []byte, templateReader io.ReadSeeker, f
// Fills form using the template reader with json reader, outputs to byte, to be saved to afero file.
formerr := api.FillForm(templateReader, readJSON, buf, conf)
if formerr != nil {
return nil, err
return nil, formerr
}

tempFile, err := g.newTempFileWithName(fileName) // Will use g.newTempFileWithName for proper memory usage, saves the new temp file with the fileName
Expand Down Expand Up @@ -729,6 +755,10 @@ func (g *Generator) LockPDFForm(templateReader io.ReadSeeker, fileName string) (
buf := new(bytes.Buffer)
// Reads all form fields on document as []form.Field
fields, err := api.FormFields(templateReader, conf)
if err != nil {
return nil, err
}

// Assembles them to the API's required []string
fieldList := make([]string, len(fields))
for i, field := range fields {
Expand Down Expand Up @@ -786,9 +816,41 @@ func (g *Generator) MergePDFFilesByContents(_ appcontext.AppContext, fileReaders
return mergedFile, nil
}

// Pdfcpu does not nil check watermarks as of version 0.9.1
// This map allows us to preemptively nil check before calling the package
func createMapOfOnlyWatermarkedPages(m map[int][]*model.Watermark) map[int][]*model.Watermark {
validMap := make(map[int][]*model.Watermark)
for page, wms := range m {
// Skip entries where the slice is nil or empty
if len(wms) == 0 {
continue
}

// Filter out nil pointers from the slice
validWms := []*model.Watermark{}
for _, wm := range wms {
if wm != nil {
validWms = append(validWms, wm)
}
}

// Only add the page to the valid map if the filtered slice is not empty
if len(validWms) > 0 {
validMap[page] = validWms
}
}
return validMap
}

func (g *Generator) AddWatermarks(inputFile afero.File, m map[int][]*model.Watermark) (afero.File, error) {
// Preemptive nil check for the map and its contents
watermarkMap := createMapOfOnlyWatermarkedPages(m)
if watermarkMap[0] == nil {
return nil, fmt.Errorf("no watermarks provided for generation")
}

buf := new(bytes.Buffer)
err := api.AddWatermarksSliceMap(inputFile, buf, m, g.pdfConfig)
err := api.AddWatermarksSliceMap(inputFile, buf, watermarkMap, g.pdfConfig)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/paperwork/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (suite *PaperworkSuite) TestCreateMergedPDF() {
ctx, err := api.ReadContext(file, generator.pdfConfig)
suite.FatalNil(err)

err = validate.XRefTable(ctx.XRefTable)
err = validate.XRefTable(ctx)
suite.FatalNil(err)

suite.Equal(3, ctx.PageCount)
Expand Down Expand Up @@ -292,7 +292,7 @@ func (suite *PaperworkSuite) TestCreateMergedPDFByContents() {
ctx, err := api.ReadContext(file, generator.pdfConfig)
suite.FatalNil(err)

err = validate.XRefTable(ctx.XRefTable)
err = validate.XRefTable(ctx)
suite.FatalNil(err)

suite.Equal(2, ctx.PageCount)
Expand Down
Loading
Loading