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

Adobe Acrobat error 110 when opening file using UseImportedTemplate #42

Open
bhelzer opened this issue May 12, 2021 · 3 comments
Open

Comments

@bhelzer
Copy link

bhelzer commented May 12, 2021

When generating a PDF file that uses imported pages I get the following error in Adobe Acrobat:

There was an error processing a page. There was a problem reading this document (110).

The file opens and displays correctly in Chrome, Brave, Safari and iOS Viewer.

If I comment out the following lines it does open in Adobe:

	page := gen.doc.ImportPage(gen.cacheFile(importData.Name), importData.Page, "/MediaBox")
	gen.doc.UseImportedTemplate(page, 0, 0, WIDTH, HEIGHT)

Also I checked, the source file does open in Acrobat as well.

@bobc82
Copy link

bobc82 commented Jul 2, 2022

I got same error when I use importing template. The method works fine and when i see the document generated in the browser, it will open fine. But once the the document is downloaded in a local folder and when i'll try to open it, adobe 110 error occurs. PS: Template doesn't contain errors.
I'll try to show a simplified version of the method i wrote:

pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: gopdf.Rect{W: 841.89, H: 595.28}})
pdf.AddPageWithOption(gopdf.PageOption{PageSize: &gopdf.Rect{W: 841.89, H: 595.28}})
fileUrl, errSt := storage.Get("private", <path>, 10*60*time.Second)
if errSt != nil {
	return errSt.Error() + "Errore 114", errSt
}
errFile := DownloadFile("template.pdf", fileUrl)
if errFile != nil {
	return errFile.Error() + "Errore 121", errFile
}
tpl1 := pdf.ImportPage("template.pdf", 1, "/MediaBox")
pdf.UseImportedTemplate(tpl1, 0, 0, 841.89, 595.28)

filePdf := pdf.GetBytesPdf()
fileReader := bytes.NewReader(filePdf)

storage.Upload("private", fileReader, <path>, fileReader.Size(), "application/pdf", nil)
return "ok", nil

@evilsocket
Copy link

+1 ... I have the same exact issue, when using a (valid) pdf template, the generated document works pretty much everywhere but Adobe Acrobat raises a 100 error. Did anybody find a workaround or fix?

@evilsocket
Copy link

This is apparently fixed in master via v1.0.13...master ... the issue seemed caused by a block like:

>>/Extend [truetrue]

instead of a correct:

>>/Extend [true true]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants