On May 9, 2014, at 6:08 AM, [email protected] wrote:

> Hi, when I do something like this is that blocking? If so how write it 
> correctly? Thanks
> 
> get...
>           PDFDocument = require('pdfkit');
> 
>           doc = new PDFDocument
>           doc.registerFont('Rosario-Italic', 'Rosario-Italic.ttf')
> 
>           doc.pipe fs.createWriteStream('output.pdf’)

If I understand you correctly, you want to do something after the PDF exists? 

doc.pipe(fs.createWriteStream(‘output.pdf’)).on(‘end’, function () { do stuff 
here } ).

>           console.log 'AFTER DOCPIPE'
> 
>           doc.font('Rosario-Italic')
>              .fontSize(25)
>              .text('Some text t!', 100, 100)
> 
>           doc.end()
> 
> 
> -- 
> Job board: http://jobs.nodejs.org/
> New group rules: 
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> --- 
> You received this message because you are subscribed to the Google Groups 
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/nodejs/e7377859-5e7c-4788-a91f-cd94298191ec%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to