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

Crash/Hang on startContext when trying to modify existing pdf #109

Open
maksimsemenov opened this issue Oct 5, 2016 · 0 comments
Open

Comments

@maksimsemenov
Copy link

maksimsemenov commented Oct 5, 2016

Hi. I'm trying to modify an existing pdf. I used this file as guidance. But unfortunately it crashes/hangs and I don't know why.

Here is my code:

const outputPath = path.resolve(folderPath, 'i130.pdf')
const pdfWriter = hummus.createWriterToModify(path.resolve('src/originalPDF/i-130.pdf'), {
   modifiedFilePath: outputPath
})
const pageModifier = new hummus.PDFPageModifier(pdfWriter, 0)
pageModifier.startContext()
const context = pageModifier.getContext()
context.writeText(data.name || 'NONE', 34, 300, {
  size: 16,
  colorspace: 'gray',
  color: 0x00
})
pageModifier.endContext().writePage()
pdfWriter.end()

So the problem occurs right after I'm trying to start new context.
What can cause that problem?

UPD. It seems that problem occurs only with files that have an interactive content in it. Like fields or checkboxes. Is there any way around that?

@maksimsemenov maksimsemenov changed the title Coach/Hang on startContext when trying to modify existing pdf Crash/Hang on startContext when trying to modify existing pdf Oct 5, 2016
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

1 participant