Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8425837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:23:02+00:00 2026-06-10T04:23:02+00:00

I hope that there is someone that can help with this problem since I

  • 0

I hope that there is someone that can help with this problem since I don’t get it myself.

I compiled the newest version of pdf2swf and everything is working fine, except of when I want to use it as a spawned child_process in NodeJS.

When I use the same command as a exec, it works again.
To provide some code example:

// convert a pdf to swf using exec (works)
var tmpSwfLocation = docsDir+'/Paper.pdf.swf';
var pdf2swf = cp.exec('pdf2swf '+tmpPDFLocation+' -o '+tmpSwfLocation+' -G -v -f -T 9 -t -j '+quality+' -s subpixels='+resolution+' -s storeallcharacters -s poly2bitmap', function(err, stdout, stderr){
  console.log(stdout);
  console.log(stderr);
  var end = Date.now();
  console.log('pdf2swf: SWF created in '+((end-start) /1000)+' seconds');
});

// convert a pdf to swf (does not work)
var tmpSwfLocation = docsDir+'/Paper.pdf.swf';
var pdf2swf = cp.spawn('pdf2swf', ['-G','-v','-f','-T 9', '-t', '-j '+quality,'-s subpixels='+resolution,'-s storeallcharacters', '-s poly2bitmap',tmpPDFLocation, '-o '+tmpSwfLocation],{setsid:true});
pdf2swf.stdout.on('data',function(output){
  console.log("pdf2swf:"+output)
});
pdf2swf.stderr.on('data',function(output){
  console.log("pdf2swf ERROR:"+output);
});
pdf2swf.stdout.on('end', function(output){
  var end = Date.now();
  console.log('pdf2swf: SWF created in '+((end-start) /1000)+' seconds');
});

The spawn process breaks in the very end, when the child_process is trying to write data into the file:

pdf2swf:NOTICE  Writing SWF file  /home/bitnami/flipdoc/ec2-instances/worker/pdf_test/test_directory/test-Testfile_31MB_26Pages.pdf_0/docs/Paper.pdf.swf
pdf2swf:FATAL   Could not create " /home/bitnami/flipdoc/ec2-instances/worker/pdf_test/test_directory/test-Testfile_31MB_26Pages.pdf_0/docs/Paper.pdf.swf". 

Using exec, the process finalizes successfully with

pdf2swf:NOTICE  Writing SWF file  /home/bitnami/flipdoc/ec2-instances/worker/pdf_test/test_directory/test-Testfile_31MB_26Pages.pdf_0/docs/Paper.pdf.swf

and a existent file.

Additional information:
Before the whole process I execute a recursive chmod 777 on the whole “test_directory”.

Greets

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:23:04+00:00Added an answer on June 10, 2026 at 4:23 am

    Solved it myself… Never (in the means of don’t even think about it…) use spaces in the arguments to the spawn process. if you have a param=value argument which can use spaces in between, just row them up in the array with every other argument.

    the source code from above for spawn looks now like this:

    var pdf2swf = cp.spawn('pdf2swf', [tmpPDFLocation, '-o',tmpSwfLocation,'-G','-vvv','-f','-T','9', '-t', '-j',quality,'-s','subpixels='+resolution,'-s','storeallcharacters', '-s','poly2bitmap']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope someone can help with solution to this problem? Currently my ASP.Net MVC
I hope that someone can help me with this. As you know when an
Hey hope someone can help as I am at my wits end with this!?
I'm having some javascript conflict problem, and hope someone can help me out. I'm
this my first question on here. I hope someone can help. It is to
Hello I have a problem with UIScrollView and I hope someone can help me.
I have a problem that I hope you can help/guide me. I saw a
thanks for reading, this is a bit long, but I hope someone can help
I hope someone here can help me see where this error is coming from.
I hope someone can help me. This has been driving me crazy for days.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.