Skip to content

Instantly share code, notes, and snippets.

View apexdodge's full-sized avatar

Zack Schwartz apexdodge

View GitHub Profile
$(document).ready(function() {
// Wait until element exists helper function
$.fn.waitUntilExists = function (handler, shouldRunHandlerOnce, isChild) {
var found = 'found';
var $this = $(this.selector);
var $elements = $this.not(function () { return $(this).data(found); }).each(handler).data(found, true);
if (!isChild)
{
(window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] =
<div style="page-break-before: always; text-align: center;">
<h1 style="text-align: center;">{ApplicationCode}</h1>
<h2 style="text-align: center;">{ApplicationName}</h2>
<h3 style="text-align: center;">{ApplicationCategoryName}</h3>
<html style="color:green;" lang="en">
<head>
<title>Getting Started with Api2Pdf.com</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="row justify-content-md-center text-center">
<img src="https://www.api2pdf.com/wp-content/themes/api2pdf/assets/images/logo.png" />
</div>
<html>
<head>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<style>
#container {
min-width: 800px;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>A simple, clean, and responsive HTML invoice template</title>
<style>
.invoice-box {
max-width: 800px;
margin: auto;
<html>
<head>
<script src="https://cdn.anychart.com/releases/8.3.0/js/anychart-base.min.js"></script>
<style>
#container {
min-width: 800px;
max-width: 800px;
height: 400px;
@apexdodge
apexdodge / gist:5e67764b4722e280c01ff53701535ded
Created July 26, 2018 02:58
Bootstrap 4 Packing Slip HTML Template
<html lang="en">
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<main role="main" class="container">
<div class="row">
<div class="col-8">
@apexdodge
apexdodge / gist:58d543918aa4b050d87e9b6b375a994c
Created August 21, 2018 20:00
HTML to force page breaks when printing to PDF
<div style="page-break-before:always;">
<p>YOUR CONTENT 1</p>
</div>
<div style="page-break-before:always;">
<p>YOUR CONTENT 2</p>
</div>
<div style="page-break-before:always;">
<p>YOUR CONTENT 3</p>
@apexdodge
apexdodge / gist:8bd58e37f6b78ea711401860e7b64479
Created August 21, 2018 21:00
footerTemplate example for headless chrome
<div class=\"page-footer\" style=\"width:100%; text-align:right; font-size:12px;\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>
@apexdodge
apexdodge / gist:b94f217286a619916ddc193fab8d12f3
Created August 21, 2018 21:02
sample api2pdf payload for headless chrome header and footer with page numbers
{
"html": "<p>Hello World</p>",
"inlinePdf": true,
"fileName": "test.pdf",
"options": {
"displayHeaderFooter": true,
"footerTemplate": "<div class=\"page-footer\" style=\"width:100%; text-align:right; font-size:12px;\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>"
}
}