This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* compile with: $ gcc pdfcrowd.c -lcurl -o pdfcrowd */ | |
#include <curl/curl.h> | |
/* | |
* return values: | |
* 0 success | |
* 1 curl fatal error | |
* 2 curl error | |
* >399 API error (HTTP status code) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
<script> | |
// If *table* defines <thead> then this function replaces the table with N | |
// tables separated by a page break. Each new table starts with <thead> and its | |
// height is at most maxHeight pixels. | |
// | |
// *table* must not have the id attribute since it is cloned N-times. Use the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uses the PHP PEAR modules for sending MIME email | |
// http://pear.php.net/package/Mail | |
// http://pear.php.net/package/Mail_Mime | |
<?php | |
require 'pdfcrowd.php'; | |
require_once('Mail.php'); | |
require_once('Mail/mime.php'); | |
$client = new \Pdfcrowd\HtmlToPdfClient($username, $apikey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'pdfcrowd.php'; | |
try | |
{ | |
// generate a PDF file | |
$client = new \Pdfcrowd\HtmlToPdfClient($username, $apikey); | |
$pdf = $client->convertString('Hello World'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'pdfcrowd.php'; | |
try | |
{ | |
// generate a PDF file | |
$client = new Pdfcrowd($username, $apikey); | |
$pdf = $client->convertHtml("Hello World"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uses the PHP PEAR modules for sending MIME email | |
// http://pear.php.net/package/Mail | |
// http://pear.php.net/package/Mail_Mime | |
<?php | |
require 'pdfcrowd.php'; | |
require_once('Mail.php'); | |
require_once('Mail/mime.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dig @8.8.8.8 +short txt _cloud-netblocks.googleusercontent.com | \ | |
sed 's/"//g; s/ip4://g; s/ip6://g;' | \ | |
tr ' ' '\n' | \ | |
grep include | cut -d ':' -f2 | \ | |
xargs dig @8.8.8.8 +short txt | \ | |
sed 's/"//g; s/ip4://g; s/ip6://g;' | tr ' ' '\n' | grep '/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <curl/curl.h> | |
#define API_ENDPOINT "https://api.pdfcrowd.com/convert/latest/" | |
#define USERNAME "demo" | |
#define API_KEY "ce544b6ea52a5621fb9d55f8b542d14d" | |
/* structure for conversion options */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <curl/curl.h> | |
const char* api_url = "https://api.pdfcrowd.com/convert/latest/"; | |
const char* username = "demo"; | |
const char* api_key = "ce544b6ea52a5621fb9d55f8b542d14d"; |
OlderNewer