I hereby claim:
- I am illbzo1 on github.
- I am tylerlmoore32 (https://keybase.io/tylerlmoore32) on keybase.
- I have a public key ASDhsIgCVHKd_PwBlIPJqbDTgv1L65n3Z2eQ67UbFXB6lAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var https = require("https"), | |
fs = require("fs"); | |
var payload = JSON.stringify({ | |
user_credentials: "YOUR_API_KEY_HERE", | |
doc: { | |
document_content: "<!DOCTYPE html><html><head><title>Javascript PDF Sample</title></head><body>Hello from Javascript!</body></html>", | |
name: "test.pdf", | |
document_type: "pdf", | |
test: true |
var request = require('request'); | |
var fs = require('fs'); | |
var content = "<html><body>TEST!</body></html>"; | |
config = { | |
url: 'https://docraptor.com/docs', | |
encoding: null, //IMPORTANT! This produces a binary body response instead of text | |
headers: { | |
'Content-Type': 'application/json' | |
}, |
#This example will create a sample asynchronous pdf document with the authentication information as part of the POST data | |
curl -H "Content-Type:application/json" -d'{"user_credentials":"YOUR_API_KEY_HERE", "doc":{"name":"async_example.pdf", "document_type":"pdf", "async":"true", "test":"true", "document_url":"https://docraptor.com"}}' http://docraptor.com/docs > async_example.pdf | |
#Making an asynchronous request will return some JSON with a status_id key like '{"status_id":"123454321"}' | |
cat async_example.pdf | |
#You can then use the status_id key to check the status of your asynchronous job | |
curl http://docraptor.com/status/123454321 -H "Content-Type:application/json" -d '{"user_credentials":"YOUR_API_KEY_HERE"}' | |
#Once your job has completed, you will recieve a response that contains the download_url for your document |
<style type="text/css"> | |
/* setup the page */ | |
@page { | |
size: US-Letter; | |
margin: 0 0 35mm 0; | |
background: #ffffff; | |
} | |
/* setup the footer */ | |
@page { |
<style type="text/css"> | |
/* setup the page */ | |
@page { | |
size: US-Letter; | |
margin: 0 0 35mm 0; | |
background: #ffffff; | |
} | |
/* setup the footer */ | |
@page { |
<%= show_for @random do |s| %> | |
<%= s.attribute :title %> | |
<% end %> | |
<%= link_to 'Edit', edit_random_path(@random) %> | | |
<%= link_to 'Back', randoms_path %> | |
<%= link_to("Download Random PDF", random_path(@random, format: :pdf)) %> |
def show | |
@random = Random.find(params[:id]) | |
respond_to do |format| | |
format.html | |
format.pdf { doc_raptor_send } | |
end | |
end | |
def doc_raptor_send(options = { }) | |
default_options = { |
def show | |
@random = Random.find(params[:id]) | |
respond_to do |format| | |
format.html | |
format.pdf { doc_raptor_send } | |
end | |
end |
asdf |