Comments (6)
this part looks like a problem:
pageModifier = new hummus.PDFPageModifier pdfWriter,0
pageModifier.startContext().getContext() #.writeText 'Test Text',
pageModifier = new hummus.PDFPageModifier pdfWriter,0
try to remove the first 2 lines of this part.
from hummusjs.
Oh sorry, my fault. Copy paste mistake.
The executed js is:
// Generated by CoffeeScript 1.9.2
(function() {
var hummus, pageModifier, pdfWriter;
hummus = require('hummus');
pdfWriter = hummus.createWriterToModify('./test.pdf', {
modifiedFilePath: './test.pdf'
});
pageModifier = new hummus.PDFPageModifier(pdfWriter, 0);
pageModifier.startContext().getContext().writeText('Test Text', 75, 10, {
font: pdfWriter.getFontForFile('./arial.ttf'),
size: 50,
colorspace: 'gray',
color: 0x00
});
pageModifier.endContext().writePage();
pdfWriter.end();
console.log('done - ok');
}).call(this);
I get:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6795310 in PDFArray::GetLength() () from /root/pdf/node_modules/hummus/build/Release/hummus.node
(gdb) backtrace
#0 0x00007ffff6795310 in PDFArray::GetLength() () from /root/pdf/node_modules/hummus/build/Release/hummus.node
#1 0x00007ffff672cf16 in PDFArrayDriver::ToJSArray(v8::FunctionCallbackInfo<v8::Value> const&) () from /root/pdf/node_modules/hummus/build/Release/hummus.node
#2 0x00000000007a2d48 in v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) ()
#3 0x00000000007c3874 in v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) ()
The pdf was created with MS Word and Mac OS X 10.9.5 Quartz PDFContext
Found out that the segfault is not happening when I do PDFPageModifier(pdfWriter, 1)
Write to 2nd page.
from hummusjs.
Good. must be something unexpected data from with one of the fields. thanks. can you send me the test.pdf file? miminize possible mishaps in recreating the issue on my station.
b.t.w how did you get this beautiful stack trace?
from hummusjs.
It's gdb
and I compiled node with --gdb
# what to start
gdb --args node test
# start node test
(gdb) run
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6795310 in PDFArray::GetLength() () from /root/pdf/node_modules/hummus/build/Release/hummus.node
# print stacktrace
(gdb) backtrace
I send you the pdf by email.
from hummusjs.
oh alright.
got it. didn't expect annotations object to be an indirect array. pahhh.
checkin a solution, published to npm. should be fine now.
from hummusjs.
thx, with 1.0.40
the segfault is gone :)
from hummusjs.
Related Issues (20)
- Is there a way to put an image inside a cell in the tables?
- Error library v1.0.109 HOT 1
- Text replace
- Annotation modification
- Remove or replace some text in PDF file
- Build failed after upgrading node from 14.x to 15.x (docker - ubuntu) HOT 1
- unable to append to page, make sure source file exists at merge
- How to remove Rectangle using position?
- Spelling Error: "parhaps" HOT 2
- Last commit has broken the instalation on CentOS7 HOT 6
- Invalid PDF input causes `SIGSEGV` crash HOT 15
- unable to append page, make sure it's fine HOT 2
- whitesource scan issues caused by minimist 0.0.8 HOT 1
- @galkahana @filmerjarred
- How to save the splitted pdf to another directory
- TypeError: Unable to create PDF file, make sure that output file target is available
- Build failed with v1.0.115 with node v12 HOT 2
- Typing correction HOT 1
- TypeError: Unable to write page when calling writePage HOT 5
- Delete object from pdf HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hummusjs.