fix(libreoffice): accept PDF/A-1b instead of PDF/A-1a (#751)

This commit is contained in:
Julien Neuhart
2023-12-13 12:40:09 +01:00
parent 9256a203ef
commit 0d3942848c
7 changed files with 81 additions and 25 deletions

View File

@@ -51,7 +51,7 @@ type Options struct {
// Optional.
PageRanges string
// PdfFormats allows to convert the resulting PDF to PDF/A-1a, PDF/A-2b,
// PdfFormats allows to convert the resulting PDF to PDF/A-1b, PDF/A-2b,
// PDF/A-3b and PDF/UA.
// Optional.
PdfFormats gotenberg.PdfFormats

View File

@@ -275,7 +275,7 @@ func (p *libreOfficeProcess) pdf(ctx context.Context, logger *zap.Logger, inputP
switch options.PdfFormats.PdfA {
case "":
case gotenberg.PdfA1a:
case gotenberg.PdfA1b:
args = append(args, "--export", "SelectPdfVersion=1")
case gotenberg.PdfA2b:
args = append(args, "--export", "SelectPdfVersion=2")

View File

@@ -394,7 +394,7 @@ func TestLibreOfficeProcess_pdf(t *testing.T) {
expectError: false,
},
{
scenario: "success (PDF/A-1a)",
scenario: "success (PDF/A-1b)",
libreOffice: newLibreOfficeProcess(
libreOfficeArguments{
binPath: os.Getenv("LIBREOFFICE_BIN_PATH"),
@@ -417,7 +417,7 @@ func TestLibreOfficeProcess_pdf(t *testing.T) {
return fs
}(),
options: Options{PdfFormats: gotenberg.PdfFormats{PdfA: gotenberg.PdfA1a}},
options: Options{PdfFormats: gotenberg.PdfFormats{PdfA: gotenberg.PdfA1b}},
cancelledCtx: false,
start: true,
expectError: false,