Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
var http = require('http'); var pdf = require('html-pdf'); const PORT = 3000; var server = http.createServer((req, res) => { var html = 'https://nubecolectiva.com/uploads/archivo.pdf'; // tambiƩn: // var var html = 'C:\Downloads\archivo.pdf'; // var var html = ' HTML Content ... '; pdf.create(html).toStream((err, stream) => { if (err) { console.error(err); res.status(500); res.end(JSON.stringify(err)); return; } res.setHeader('Content-Type', 'application/pdf'); res.setHeader('Content-Disposition', 'attachment; filename=archivo.pdf;'); stream.pipe(res); }); }); server.listen(PORT, () => { console.log('Server listening on Port: %s', PORT); });
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)