pdfcpu icon indicating copy to clipboard operation
pdfcpu copied to clipboard

About the version of xRefTable

Open jimbirthday opened this issue 11 months ago • 3 comments

Thank you for submitting a possible bug!

Please ensure the following:

  • Your issue is based on the latest commit
  • State your OS and OS version - windows11

this my pdf file info

PDF version: | 1.7

this my code

	pdfFile := "1.pdf"

	// 将PDF页面渲染为图像
	err := api.ExtractImagesFile(pdfFile, "./1.png", []string{"1"}, &model.Configuration{
		WriteXRefStream: false,
	})
	if err != nil {
		fmt.Fprintf(os.Stderr, "Extraction error: %v\n", err)
		return
	}

log

Extraction error: Read: xRefTable failed: parseTrailerDict: PDF1.4 conformant reader: found incompatible version: 1.7

jimbirthday avatar Apr 01 '24 17:04 jimbirthday

image change WriteXRefStream to true, result same

jimbirthday avatar Apr 01 '24 17:04 jimbirthday

Did you ensure your input file passes validation? pdfcpu val in.pdf

hhrutter avatar Apr 03 '24 21:04 hhrutter

This file's trailer seems to be corrupted somehow. Working on the assumption that you can open this file with A.Preview or A.Reader.. If you can share the file I will look into this and provide a fix. Thank you!

hhrutter avatar Apr 06 '24 17:04 hhrutter