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

'redirection unexpected' #29

Open
neoborn opened this issue Oct 23, 2014 · 0 comments
Open

'redirection unexpected' #29

neoborn opened this issue Oct 23, 2014 · 0 comments

Comments

@neoborn
Copy link

neoborn commented Oct 23, 2014

Hi,

I encountered this error while using this module in Ubuntu server (14.04 LTS)

pdfgenerator stderr /bin/sh: 1: 
pdfgenerator stderr Syntax error: redirection unexpected
pdfgenerator stderr 
error in pdfgenerator: PDF conversion failed with exit of 2

From my research, it's could be because of Ubuntu's default shell, which is Dash (/bin/sh) and it should be /bin/bash shell. *http://stackoverflow.com/questions/2462317/bash-syntax-error-redirection-unexpected

Additionally, the /etc/passwd file shows that the account that I used to run the code has /bin/bash as its default shell.

any idea on this matter?

Here is my code:

            var html = ejs.render(templateString, <object_to_render>);

            var filename = 'application-'+app._id + '.pdf';
            var filepath = config.generatedDir + '/' + filename;

            var pdf = new NodePDF(null, filepath, {
                'content': html,
                'args': '--debug=true',
                'paperSize': {
                    'pageFormat': 'A4',
                    'footer': {
                        'height': '0.7cm',
                        'contents': '<p style="text-align:center">{currentPage} / {pages}</p>'
                    }
                },
                'zoomFactor': 1.1
            });

            pdf.on('error', function(msg){
                console.log('error in pdfgenerator:', msg);
            });

            pdf.on('done', function(filePath){
                console.log(filePath);
                if (filePath) {
                    //save file information to database
                }
            });

            pdf.on('stdout', function(stdout){
                console.log('pdfgenerator stdout', stdout);
            });


            pdf.on('stderr', function(stderr){
                console.log('pdfgenerator stderr', stderr);
            });

appreciate any help.
thank you.

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