Skip to content

Commit

Permalink
disable fonts and adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncaci committed Jan 22, 2025
1 parent aeca4de commit 5d34278
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/paperwork/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ func (g *Generator) GetPdfFileInfo(fileName string) (*pdfcpu.PDFInfo, error) {
return nil, err
}
defer file.Close()
return api.PDFInfo(file, fileName, nil, g.pdfConfig)
return api.PDFInfo(file, fileName, nil, false, g.pdfConfig)
}

func (g *Generator) GetPdfFileInfoForReadSeeker(rs io.ReadSeeker) (*pdfcpu.PDFInfo, error) {
return api.PDFInfo(rs, "", nil, g.pdfConfig)
return api.PDFInfo(rs, "", nil, false, g.pdfConfig)
}

// Get file information of a single PDF
func (g *Generator) GetPdfFileInfoByContents(file afero.File) (*pdfcpu.PDFInfo, error) {
return api.PDFInfo(file, file.Name(), nil, g.pdfConfig)
return api.PDFInfo(file, file.Name(), nil, false, g.pdfConfig)
}

// CreateMergedPDFUpload converts Uploads to PDF and merges them into a single PDF
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 @@ -123,7 +123,7 @@ func (suite *PaperworkSuite) TestPDFFromImages() {
files, err := os.ReadDir(tmpDir)
suite.FatalNil(err)

suite.Equal(4, len(files), "did not find 2 images")
suite.Equal(2, len(files), "did not find 2 images")

for _, file := range files {
checksum, sha256ForPathErr := suite.sha256ForPath(path.Join(tmpDir, file.Name()), nil)
Expand Down Expand Up @@ -182,7 +182,7 @@ func (suite *PaperworkSuite) TestPDFFromImagesNoRotation() {
files, err := os.ReadDir(tmpDir)
suite.FatalNil(err)

suite.Equal(4, len(files), "did not find 2 images")
suite.Equal(2, len(files), "did not find 2 images")

for _, file := range files {
checksum, sha256ForPathErr := suite.sha256ForPath(path.Join(tmpDir, file.Name()), nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (suite *PaperworkServiceSuite) TestPrimeDownloadMoveUploadPDFGeneratorUnpro
}

func (suite *PaperworkServiceSuite) pdfFileInfo(generator *paperwork.Generator, file afero.File) (*pdfcpu.PDFInfo, error) {
return api.PDFInfo(file, file.Name(), nil, generator.PdfConfiguration())
return api.PDFInfo(file, file.Name(), nil, false, generator.PdfConfiguration())
}

func (suite *PaperworkServiceSuite) setupOrdersDocument() (services.PrimeDownloadMoveUploadPDFGenerator, models.Order) {
Expand Down

0 comments on commit 5d34278

Please sign in to comment.