added yaml parser and german variables
This commit is contained in:
commit
f4c078ea8c
745 changed files with 219082 additions and 0 deletions
496
#kostenerstattung.html#
Normal file
496
#kostenerstattung.html#
Normal file
|
@ -0,0 +1,496 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
|
<title>Kostenerstattungsantrag Wikimedia Deutschland e.V.</title>
|
||||||
|
<link rel="stylesheet" href="kostenerstattung.css">
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||||
|
<script src="polyfiller.js"></script>
|
||||||
|
<script src="iban.js/iban.js"></script>
|
||||||
|
<script>
|
||||||
|
var eintraege = 0;
|
||||||
|
|
||||||
|
function neuerIndex()
|
||||||
|
{
|
||||||
|
var aufstellung = document.getElementById('Aufstellung'),
|
||||||
|
eintraege = document.querySelectorAll('#Aufstellung tbody tr');
|
||||||
|
for(var n = 0; n < eintraege.length; n++)
|
||||||
|
{
|
||||||
|
eintraege[n].querySelector('legend').textContent = n+1+'. Position';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkIban()
|
||||||
|
{
|
||||||
|
iban = document.getElementById('iban');
|
||||||
|
if( document.getElementById('eu').checked ) {
|
||||||
|
|
||||||
|
if(IBAN.isValid(iban.value))
|
||||||
|
{
|
||||||
|
if(iban.classList.contains('invalid')) iban.classList.remove('invalid');
|
||||||
|
iban.classList.add('valid');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(iban.classList.contains('valid')) iban.classList.remove('valid');
|
||||||
|
iban.classList.add('invalid');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(iban.classList.contains('invalid')) iban.classList.remove('invalid');
|
||||||
|
if(iban.classList.contains('valid')) iban.classList.remove('valid');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function neueZeileGebraucht()
|
||||||
|
{
|
||||||
|
var eintraege = document.querySelectorAll('#Aufstellung tbody tr');
|
||||||
|
if(2 === eintraege.length)
|
||||||
|
{
|
||||||
|
addLine();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var datum = document.getElementById('Datum['+(eintraege.length-1)+']'),
|
||||||
|
betrag = document.getElementById('Betrag['+(eintraege.length-1)+']');
|
||||||
|
|
||||||
|
if("" !== datum.value || "0.00" !== betrag.value) addLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
function aktualisiereSumme()
|
||||||
|
{
|
||||||
|
var aufstellung = document.getElementById('Aufstellung'),
|
||||||
|
eintraege = document.querySelectorAll('#Aufstellung tbody tr'),
|
||||||
|
summe = 0-parseFloat(document.getElementById('vorschuss').value);
|
||||||
|
for(var e = 1; e < eintraege.length-1; e++)
|
||||||
|
{
|
||||||
|
// console.log('aktualisiereSumme/Summe: '+summe);
|
||||||
|
// console.log('aktualisiereSumme/eintraege[e].id: '+eintraege[e].id);
|
||||||
|
var id = parseInt(eintraege[e].id.match(/(\d+)/)[0]);
|
||||||
|
summe += parseFloat(document.getElementById('Betrag['+id+']').querySelector('input').value);
|
||||||
|
}
|
||||||
|
document.getElementById('Summe').textContent = summe.toLocaleString(false, { minimumFractionDigits: 2, useGrouping: true } );
|
||||||
|
// document.getElementById('Summe').textContent = summe.toFixed(2).toLocaleString();
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkForUpdates()
|
||||||
|
{
|
||||||
|
// neueZeileGebraucht();
|
||||||
|
aktualisiereSumme();
|
||||||
|
}
|
||||||
|
|
||||||
|
function erstellePosition(p)
|
||||||
|
{
|
||||||
|
var vorlage = document.getElementById('neuerEintrag'),
|
||||||
|
neuerEintrag, inputs, labels, spans, textareas, tds;
|
||||||
|
|
||||||
|
neuerEintrag = document.importNode(vorlage.content, true);
|
||||||
|
neuerEintrag.querySelector('tr').id='Reihe['+p+']';
|
||||||
|
tds = neuerEintrag.querySelectorAll('td');
|
||||||
|
tds[0].id = 'Position['+p+']';
|
||||||
|
tds[1].id = 'Beschreibung['+p+']';
|
||||||
|
tds[2].id = 'Belegdatum['+p+']';
|
||||||
|
tds[3].id = 'Betrag['+p+']';
|
||||||
|
tds[4].id = 'Delete['+p+']';
|
||||||
|
tds[0].textContent = p;
|
||||||
|
tds[4].querySelector('button').onclick = delLine;
|
||||||
|
tds[4].querySelector('button').ontouch = delLine;
|
||||||
|
tds[3].querySelector('input').onchange = checkForUpdates;
|
||||||
|
spans = neuerEintrag.querySelectorAll('span');
|
||||||
|
return neuerEintrag;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fadeIn(element)
|
||||||
|
{
|
||||||
|
console.log('Fading in');
|
||||||
|
var op = 0.1; // initial opacity
|
||||||
|
element.style.opacity = 0;
|
||||||
|
element.style.filter = 'alpha(opacity=0)';
|
||||||
|
element.style.display = 'table-row';
|
||||||
|
var timer = setInterval(function ()
|
||||||
|
{
|
||||||
|
element.style.opacity = op;
|
||||||
|
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
|
||||||
|
op += op * 0.1;
|
||||||
|
if (op >= 1)
|
||||||
|
{
|
||||||
|
clearInterval(timer);
|
||||||
|
element.style.opacity = 1;
|
||||||
|
element.style.filter = 'alpha(opacity=100)';
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
function fadeOut(element)
|
||||||
|
{
|
||||||
|
console.log('Fading out');
|
||||||
|
var op = 1; // initial opacity
|
||||||
|
var timer = setInterval(function ()
|
||||||
|
{
|
||||||
|
if (op <= 0.1)
|
||||||
|
{
|
||||||
|
clearInterval(timer);
|
||||||
|
element.style.display = 'none';
|
||||||
|
}
|
||||||
|
element.style.opacity = op;
|
||||||
|
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
|
||||||
|
op -= 0.05;
|
||||||
|
}, 25);
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeAfterTimeout(element)
|
||||||
|
{
|
||||||
|
console.log('Removing '+element.id);
|
||||||
|
var eintraege = document.querySelectorAll('#Aufstellung tbody tr'),
|
||||||
|
aufstellung = document.getElementById('Aufstellung'),
|
||||||
|
currentId = parseInt(element.id.match(/(\d+)/)[0]);
|
||||||
|
element.parentNode.removeChild(document.getElementById('Reihe['+currentId+']'));
|
||||||
|
// console.log('removeAfterTimeout/currentId: '+currentId);
|
||||||
|
// console.log('removeAfterTimeout/eintraege.length: '+eintraege.length);
|
||||||
|
if((currentId+1) < (eintraege.length))
|
||||||
|
{
|
||||||
|
// if there are more entries after the one supposed to be deleted, change their index values to match their new position
|
||||||
|
for(var i = currentId+1; i < eintraege.length-1; i++)
|
||||||
|
{
|
||||||
|
// console.log('removeAfterTimeout/i: '+i);
|
||||||
|
var regex = new RegExp(/\d+/),
|
||||||
|
newIdx = i-1,
|
||||||
|
pos = document.getElementById('Reihe['+i+']');
|
||||||
|
// console.log('removeAfterTimeout/newIdx: '+newIdx);
|
||||||
|
// console.log('removeAfterTimeout/pos.id before: '+pos.id);
|
||||||
|
pos.id=pos.id.replace(regex,newIdx);
|
||||||
|
// console.log('removeAfterTimeout/pos.id after: '+pos.id);
|
||||||
|
for(var n = 0; n < pos.childNodes.length; n++)
|
||||||
|
{
|
||||||
|
if(1 == pos.childNodes[n].nodeType)
|
||||||
|
{
|
||||||
|
pos.childNodes[n].id=pos.childNodes[n].id.replace(/\d/,newIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById('Position['+newIdx+']').textContent = newIdx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkForUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
|
function delLine()
|
||||||
|
{
|
||||||
|
var eintraege = document.querySelectorAll('#Aufstellung tbody tr'),
|
||||||
|
aufstellung = document.getElementById('Aufstellung');
|
||||||
|
var current = this.parentNode.parentNode;
|
||||||
|
console.log(current);
|
||||||
|
fadeOut(current);
|
||||||
|
setTimeout(removeAfterTimeout, 1100, current);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addLine()
|
||||||
|
{
|
||||||
|
var eintraege = document.querySelectorAll('#Aufstellung tbody tr'),
|
||||||
|
aufstellung = document.getElementById('Aufstellung').querySelector('tbody');
|
||||||
|
|
||||||
|
var neu = erstellePosition(eintraege.length-1);
|
||||||
|
aufstellung.insertBefore(neu,document.getElementById('more'));
|
||||||
|
// var eingefuegt = aufstellung.querySelector('fieldset:last-of-type');
|
||||||
|
var eingefuegt = aufstellung.querySelector('tr:nth-last-of-type(2)');
|
||||||
|
// neuerIndex();
|
||||||
|
console.log('Adding '+eingefuegt.id);
|
||||||
|
fadeIn(eingefuegt);
|
||||||
|
}
|
||||||
|
|
||||||
|
function splitDateString(date) { return date.match(/(\d{4})-(\d{2})-(\d{2})/); }
|
||||||
|
function splitTimeString(time) { return time.match(/(\d{2}):(\d{2})/); }
|
||||||
|
|
||||||
|
function restoreFromCookie()
|
||||||
|
{
|
||||||
|
var c = document.cookie.match(new RegExp('Kostenerstattung' + '=([^;]+)'));
|
||||||
|
console.log(c);
|
||||||
|
if(c) {
|
||||||
|
c && (c = JSON.parse(c[1]));
|
||||||
|
document.getElementById('projekt').value = c.projekt;
|
||||||
|
document.getElementById('ansprech').value = c.ansprech;
|
||||||
|
document.getElementById('real').value = c.real;
|
||||||
|
document.getElementById('email').value = c.email;
|
||||||
|
document.getElementById('phone').value = c.phone;
|
||||||
|
document.getElementById('iban').value = c.iban;
|
||||||
|
document.getElementById('bic').value = c.bic;
|
||||||
|
document.getElementById('bank').value = c.bank;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function storeToCookie()
|
||||||
|
{
|
||||||
|
var c =
|
||||||
|
{
|
||||||
|
'projekt': document.getElementById('projekt').value,
|
||||||
|
'ansprech': document.getElementById('ansprech').value,
|
||||||
|
'real': document.getElementById('real').value,
|
||||||
|
'email': document.getElementById('email').value,
|
||||||
|
'phone': document.getElementById('phone').value,
|
||||||
|
'iban': document.getElementById('iban').value,
|
||||||
|
'bic': document.getElementById('bic').value,
|
||||||
|
'bank': document.getElementById('bank').value,
|
||||||
|
};
|
||||||
|
document.cookie = 'Kostenerstattung='+JSON.stringify(c)+'; domain='+window.location.host.toString()+'; path=/extern; expires='+(new Date().getTime()+1000*60*60*24*365);
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
document.getElementById("printDE_top").addEventListener('click', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printEN_top").addEventListener('click', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printDE_top").addEventListener('touch', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printEN_top").addEventListener('touch', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printDE_bottom").addEventListener('click', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printEN_bottom").addEventListener('click', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printDE_bottom").addEventListener('touch', function() { window.print(); }, true);
|
||||||
|
document.getElementById("printEN_bottom").addEventListener('touch', function() { window.print(); }, true);
|
||||||
|
document.getElementById('vorschuss').addEventListener('change', aktualisiereSumme);
|
||||||
|
document.getElementById('iban').addEventListener('change', checkIban);
|
||||||
|
/* document.getElementById('save').addEventListener('click', storeToCookie);
|
||||||
|
document.getElementById('save').addEventListener('touch', storeToCookie);*/
|
||||||
|
document.getElementById('addbutton_de').addEventListener('click', addLine);
|
||||||
|
document.getElementById('addbutton_de').addEventListener('touch', addLine);
|
||||||
|
document.getElementById('addbutton_en').addEventListener('click', addLine);
|
||||||
|
document.getElementById('addbutton_en').addEventListener('touch', addLine);
|
||||||
|
// if(document.cookie) restoreFromCookie();
|
||||||
|
}
|
||||||
|
|
||||||
|
function init2()
|
||||||
|
{
|
||||||
|
webshims.setOptions('forms-ext', {types: 'date'});
|
||||||
|
webshims.polyfill('forms forms-ext');
|
||||||
|
addLine();
|
||||||
|
aktualisiereSumme();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('DOMContentLoaded',init);
|
||||||
|
window.addEventListener('load',init2);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<input class="screen radiobutton" type="radio" id="en" name="lang" value="en" checked><label class="screen" for="en">English</label>
|
||||||
|
<input class="screen radiobutton" type="radio" id="de" name="lang" value="de"><label class="screen" for="de">Deutsch</label>
|
||||||
|
<header>
|
||||||
|
<img style="float: right;" src="logo_web.png" alt="logo">
|
||||||
|
<h1 lang="de">Antrag auf Kostenerstattung</h1>
|
||||||
|
<h1 lang="en">Reimbursement Claims</h1>
|
||||||
|
<p lang="de">Bitte beachte beim Ausfüllen die <a href="https://languwww.wikimedia.de/wiki/Gesch%C3%A4ftsordnung#Reisekostenordnung">Reisekostenordnung</a>.</p>
|
||||||
|
</header>
|
||||||
|
<div id="printcontainerDE_top" lang="de"><input type="button" value="🖶 Antrag drucken" id="printDE_top" disabled></div>
|
||||||
|
<div id="printcontainerEN_top" lang="en"><input type="button" value="🖶 Print" id="printEN_top" disabled></div>
|
||||||
|
<main>
|
||||||
|
<fieldset>
|
||||||
|
<legend lang="de">Bitte fülle die allgemeinen Daten für die Erstattung aus.</legend>
|
||||||
|
<legend lang="en">Please fill in the general data for reimbursement.</legend>
|
||||||
|
<fieldset class="iblock">
|
||||||
|
<legend lang="de">Dein Projekt / Zweck der Reise</legend>
|
||||||
|
<legend lang="en">Your project / purpose of travel</legend>
|
||||||
|
<input required type="input" size="32" id="projekt" name="Projekt" placeholder="Projekt xy" />
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="iblock">
|
||||||
|
<legend lang="de">Deine Ansprechperson bei Wikimedia</legend>
|
||||||
|
<legend lang="en">Your contact person at Wikimedia</legend>
|
||||||
|
<input required type="input" size="32" id="ansprech" name="Ansprechperson" placeholder="John Doe" />
|
||||||
|
</fieldset>
|
||||||
|
<hr />
|
||||||
|
<fieldset class="iblock">
|
||||||
|
<legend lang="de">Deine Kontaktdaten</legend>
|
||||||
|
<legend lang="en">Contact details</legend>
|
||||||
|
<!-- <p>Eine Angabe reicht bereits</p>-->
|
||||||
|
<label for="real" lang="de">Dein Realname</label>
|
||||||
|
<label for="real" lang="en">Full legal name</label>
|
||||||
|
<input required type="input" size="32" id="real" name="Realname" placeholder="Corinna Commonsuser" />
|
||||||
|
<label for="email" lang="de">E-Mail-Adresse</label>
|
||||||
|
<label for="email" lang="en">Email address</label>
|
||||||
|
<input required type="email" size="32" id="email" name="Emailadresse" placeholder="name@example.org" />
|
||||||
|
<label for="phone" lang="de">Telefonnummer</label>
|
||||||
|
<label for="phone" lang="en">Phone number</label>
|
||||||
|
<input required type="tel" size="32" id="phone" name="Telefonnummer" placeholder="0123-456789" />
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="iblock" id="bankdetails">
|
||||||
|
<legend lang="de">Auszahlungsweg</legend>
|
||||||
|
<legend lang="en">Payout method</legend>
|
||||||
|
<!-- <span style="white-space: pre;"><input class="screen" type="radio" id="eu" name="bank" value="EU" checked><label class="screen" for="eu" lang="de">EU-Banküberweisung</label><label class="screen" for="eu" lang="en">EU bank transfer</label></span>
|
||||||
|
<span style="white-space: pre;"><input class="screen" type="radio" id="noneu" name="bank" value="Non-EU"><label class="screen" for="noneu" lang="en">Non EU bank transfer</label><label class="screen" for="noneu" lang="de">Non-EU-Banküberweisung</label></span>
|
||||||
|
<span style="white-space: pre;"><input class="screen" type="radio" id="paypal" name="bank" value="PayPal"><label class="screen" for="paypal">PayPal</label></span>
|
||||||
|
<span style="white-space: pre;"><input class="screen" type="radio" id="bar" name="bank" value="Bar"><label class="screen" for="bar" lang="de">Bargeld</label><label class="screen" for="bar" lang="en">Cash</label></span>-->
|
||||||
|
<input class="screen" type="radio" id="eu" name="bank" value="EU" checked><label class="screen radio" for="eu" lang="de">EU-Banküberweisung</label><label class="screen radio" for="eu" lang="en">EU bank transfer</label>
|
||||||
|
<input class="screen" type="radio" id="noneu" name="bank" value="Non-EU"><label class="screen radio" for="noneu" lang="de">Non-EU-Banküberweisung</label><label class="screen radio" for="noneu" lang="en">Non EU bank transfer</label>
|
||||||
|
<input class="screen" type="radio" id="paypal" name="bank" value="PayPal"><label class="screen radio" for="paypal">PayPal</label>
|
||||||
|
<input class="screen" type="radio" id="bar" name="bank" value="Bar"><label class="screen radio" for="bar" lang="de">Bargeld</label><label class="screen radio" for="bar" lang="en">Cash</label>
|
||||||
|
<label class="EU nonEU" for="owner" lang="de">Kontoinhabende Person</label><label class="EU nonEU" for="owner" lang="en">Bank account owner</label><input class="EU nonEU" type="input" size="32" id="ownerDe" name="Owner" placeholder="wenn abweichend vom Realnamen" lang="de" /><input class="EU nonEU" type="input" size="32" id="ownerEn" name="Owner" placeholder="if different from full legal name" lang="en" />
|
||||||
|
<label class="EU nonEU" for="iban" lang="de">IBAN</label><label class="EU nonEU" for="iban" lang="en">Bank account number</label><input class="EU nonEU" type="input" size="32" id="iban" name="IBAN" placeholder="DE0123…" />
|
||||||
|
<label class="EU nonEU" for="bic">BIC / SWIFT</label><input class="EU nonEU" type="input" size="32" id="bic" name="BIC" placeholder="LBMU…" />
|
||||||
|
<label class="EU nonEU" for="bank" lang="de">Name der Bank</label><label class="EU nonEU" for="bank" lang="en">Name of bank</label><input class="EU nonEU" type="input" size="32" id="bank" name="Bankname" placeholder="Banky McBankface" />
|
||||||
|
<label class="nonEU" for="bankaddress" lang="en">Bank address</label><textarea lang="en" class="nonEU" id="bankaddress" style="resize:both;" cols="32" rows="4" placeholder="Street and house number
|
||||||
|
Postal code and city
|
||||||
|
Country"></textarea>
|
||||||
|
<label class="nonEU" for="address" lang="en">Your address</label><textarea lang="en" class="nonEU" id="address" style="resize:both;" cols="32" rows="4" placeholder="Street and house number
|
||||||
|
Postal code and city
|
||||||
|
Country"></textarea>
|
||||||
|
<label class="EU nonEU" for="comments" lang="en">Further comments</label><textarea lang="en" class="EU nonEU" id="comments" style="resize:both;" cols="32" rows="4" placeholder="e.g. intermediary bank,
|
||||||
|
reasons for differing account owner"></textarea>
|
||||||
|
|
||||||
|
<label class="nonEU" for="bankaddress" lang="de">Bankanschrift</label><textarea lang="de" class="nonEU" id="bankaddress" style="resize:both;" cols="32" rows="4" placeholder="Straße und Hausnummer
|
||||||
|
Postleitzahl und Ort
|
||||||
|
Land"></textarea>
|
||||||
|
<label class="nonEU" for="address" lang="de">Deine Anschrift</label><textarea lang="de" class="nonEU" id="address" style="resize:both;" cols="32" rows="4" placeholder="Straße und Hausnummer
|
||||||
|
Postleitzahl und Ort
|
||||||
|
Land"></textarea>
|
||||||
|
<label class="EU nonEU" for="comments" lang="de">Weitere Anmerkungen</label><textarea lang="de" class="EU nonEU" id="comments" style="resize:both;" cols="32" rows="4" placeholder="z. B. intermdiäre Bank, Grund für abweichende kontoinhabende Person, Routing-Nummer (für Nicht-EU-Überweisungen)"></textarea>
|
||||||
|
|
||||||
|
<label class="paypal" for="accountnumber">PayPal account</label><input class="paypal" type="input" size="32" id="paypal" placeholder="paypal@example.com" />
|
||||||
|
</fieldset>
|
||||||
|
<!-- <div id="datacontainer"><input type="button" value="💾 Diese Angaben für eine spätere Verwendung auf diesem Rechner sichern (Cookie). / Save these specifications for later use on this computer (cookie)." id="save"></div>-->
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
<fieldset id="Aufstellung_alt">
|
||||||
|
<legend class="screen" lang="de">Bitte trage deine einzelnen Kostenpositionen ein.</legend>
|
||||||
|
<legend class="screen" lang="en">Please enter your cost items.</legend>
|
||||||
|
<p class="screen" lang="de">Bitte trage nur eine Ausgabe pro Zeile ein, lege den Originalbeleg dem Antrag bei und kennzeichne den Beleg mit der entsprechenden Zeilennummer.
|
||||||
|
Aus der Beschreibung soll zu ersehen sein, ob es sich um Transport, Dienstleistung, Materialien, Verpflegung oder ähnliches handelt.
|
||||||
|
|
||||||
|
<p class="screen" lang="en">Please enter only one expense per line, provide original receipt with your claim and tag the receipt with the appropriate line number.
|
||||||
|
The description of the expense should refer to the kind of expense, e.g. travel, service, materials, food or similar.</p>
|
||||||
|
<table id="Aufstellung">
|
||||||
|
<thead><tr id="aufstellungheader" style="font-size:80%;">
|
||||||
|
<th id="spalte0">Pos.</th>
|
||||||
|
<th id="spalte1"><span lang="de">Beschreibung</span><span lang="en">Description</span></th>
|
||||||
|
<th id="spalte2"><span lang="de">Belegdatum</span><span lang="en">Date</span></th>
|
||||||
|
<th id="spalte3"><span lang="de">Betrag</span><span lang="en">Sum</span>
|
||||||
|
<input list="waehrungen" name="waehrung" id="waehrung" placeholder="EUR, or enter currency code">
|
||||||
|
<datalist id="waehrungen">
|
||||||
|
<option value="USD">United States Dollars</option>
|
||||||
|
<option value="EUR" selected="selected">Euro</option>
|
||||||
|
<option value="GBP">United Kingdom Pounds</option>
|
||||||
|
<option value="DZD">Algeria Dinars</option>
|
||||||
|
<option value="ARP">Argentina Pesos</option>
|
||||||
|
<option value="AUD">Australia Dollars</option>
|
||||||
|
<option value="BSD">Bahamas Dollars</option>
|
||||||
|
<option value="BBD">Barbados Dollars</option>
|
||||||
|
<option value="BMD">Bermuda Dollars</option>
|
||||||
|
<option value="BRR">Brazil Real</option>
|
||||||
|
<option value="BGL">Bulgaria Lev</option>
|
||||||
|
<option value="CAD">Canada Dollars</option>
|
||||||
|
<option value="CLP">Chile Pesos</option>
|
||||||
|
<option value="CNY">China Yuan Renmimbi</option>
|
||||||
|
<option value="CSK">Czech Republic Koruna</option>
|
||||||
|
<option value="DKK">Denmark Kroner</option>
|
||||||
|
<option value="XCD">Eastern Caribbean Dollars</option>
|
||||||
|
<option value="EGP">Egypt Pounds</option>
|
||||||
|
<option value="FJD">Fiji Dollars</option>
|
||||||
|
<option value="HKD">Hong Kong Dollars</option>
|
||||||
|
<option value="HUF">Hungary Forint</option>
|
||||||
|
<option value="ISK">Iceland Krona</option>
|
||||||
|
<option value="INR">India Rupees</option>
|
||||||
|
<option value="IDR">Indonesia Rupiah</option>
|
||||||
|
<option value="ILS">Israel New Shekels</option>
|
||||||
|
<option value="JMD">Jamaica Dollars</option>
|
||||||
|
<option value="JPY">Japan Yen</option>
|
||||||
|
<option value="JOD">Jordan Dinar</option>
|
||||||
|
<option value="KRW">Korea (South) Won</option>
|
||||||
|
<option value="LBP">Lebanon Pounds</option>
|
||||||
|
<option value="MYR">Malaysia Ringgit</option>
|
||||||
|
<option value="MXP">Mexico Pesos</option>
|
||||||
|
<option value="NZD">New Zealand Dollars</option>
|
||||||
|
<option value="NOK">Norway Kroner</option>
|
||||||
|
<option value="PKR">Pakistan Rupees</option>
|
||||||
|
<option value="PHP">Philippines Pesos</option>
|
||||||
|
<option value="PLZ">Poland Zloty</option>
|
||||||
|
<option value="ROL">Romania Leu</option>
|
||||||
|
<option value="RUR">Russia Rubles</option>
|
||||||
|
<option value="SAR">Saudi Arabia Riyal</option>
|
||||||
|
<option value="SGD">Singapore Dollars</option>
|
||||||
|
<option value="ZAR">South Africa Rand</option>
|
||||||
|
<option value="KRW">South Korea Won</option>
|
||||||
|
<option value="SDD">Sudan Dinar</option>
|
||||||
|
<option value="SEK">Sweden Krona</option>
|
||||||
|
<option value="CHF">Switzerland Francs</option>
|
||||||
|
<option value="TWD">Taiwan Dollars</option>
|
||||||
|
<option value="THB">Thailand Baht</option>
|
||||||
|
<option value="TTD">Trinidad and Tobago Dollars</option>
|
||||||
|
<option value="TRL">Turkey Lira</option>
|
||||||
|
<option value="VEB">Venezuela Bolivar</option>
|
||||||
|
<option value="ZMK">Zambia Kwacha</option>
|
||||||
|
</datalist>
|
||||||
|
</th>
|
||||||
|
<th id="spalte4" class="delete"></th>
|
||||||
|
</tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr id="Reihe[0]">
|
||||||
|
<td id="Position[0]" style="text-align: right;">0</td>
|
||||||
|
<td id="Beschreibung[0]"><textarea style="resize:none;" cols="45" rows="1" readonly lang="de">Vorschuss (falls zutreffend)</textarea><textarea style="resize:none;" cols="45" rows="1" readonly lang="en">Advance payment (if applicable)</textarea></td>
|
||||||
|
<td id="Belegdatum[0]"><input type="date" style="visibility:hidden;"></td>
|
||||||
|
<td id="Betrag[0]" style="text-align:right;"><input required type="number" step="0.01" value="0.00" min="0.00" max="10000.00" id="vorschuss" name="Vorschuss" style="font-size:120%; text-align: right;" /></td>
|
||||||
|
<td class="delete" id="delete[0]"></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="screen" id="more"><td colspan="4"><input type="button" id="addbutton_de" style="width:100%;" value="Ausgabe hinzufügen +" lang="de" /><input type="button" id="addbutton_en" style="width:100%;" value="Add expense +" lang="en" /></td></tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr id="Reihe[Summe]">
|
||||||
|
<td colspan="3" style="text-align: right;"><span lang="de">Summe</span><span lang="en">Total</span></td>
|
||||||
|
<td style="text-align: right;"><span class="geld" id="Summe" style="margin-left: 2em; font-weight:bold; color:black; width:8em;"></span></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<legend lang="de">Datum der Antragstellung</legend>
|
||||||
|
<legend lang="en">Date of claim</legend>
|
||||||
|
<input type="date">
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<legend lang="de">Pflichtangabe: Hiermit bestätige ich die Vollständig- und Richtigkeit meiner Angaben.</legend>
|
||||||
|
<legend lang="en">Mandatory declaration: Herewith I confirm the completeness and correctness of my data.</legend>
|
||||||
|
<input type="checkbox" id="check" name="checkbox" onchange="document.getElementById('printDE_bottom').disabled = !this.checked;
|
||||||
|
document.getElementById('printEN_bottom').disabled = !this.checked;
|
||||||
|
document.getElementById('printDE_top').disabled = !this.checked;
|
||||||
|
document.getElementById('printEN_top').disabled = !this.checked;">
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
<h2 id="faq" class="screen">Frequently asked questions (FAQ)</h2>
|
||||||
|
<!--<input class="screen" type="radio" id="en" name="lang" value="en" checked><label class="screen" for="en">English</label>
|
||||||
|
<input class="screen" type="radio" id="de" name="lang" value="de"><label class="screen" for="de">Deutsch</label>-->
|
||||||
|
<dl lang="en" class="screen">
|
||||||
|
<dt>My claims are not in Euro. What now?</dt>
|
||||||
|
<dd>When claiming expenses please select in which currency you want your expense reimbursed. Use the
|
||||||
|
<a href="https://sdw.ecb.europa.eu/curConverter.do?node=9693519">converter of the European Central Bank</a>.
|
||||||
|
Convert per line (not the sum!) using the exchange rate valid at the date of expense. If you don't provide a
|
||||||
|
currency, we'll assume you want to get reimbursed using Euro.</dd>
|
||||||
|
</dl>
|
||||||
|
<dl lang="de" class="screen">
|
||||||
|
<dt>Meine Ausgabe sind nicht in Euro. Was soll ich machen?</dt>
|
||||||
|
<dd>Wenn du Ausgaben erstattet haben willst, rechne die Ausgaben zeilenweise (nicht nur den Gesamtbetrag!) mit dem
|
||||||
|
<a href="https://sdw.ecb.europa.eu/curConverter.do?node=9693519">Währungsumrechner der Europäischen Zentralbank</a>
|
||||||
|
in die Währung um, in der du deine Kosten erstattet haben willst. Gibst du keine Währung an, nehmen wir an, dass
|
||||||
|
die Erstattung in Euro erfolgen soll.</dd>
|
||||||
|
</dl>
|
||||||
|
<div style="width: 100%; text-align:right; padding-right: 50px; font-weight:bold; font-size:90%;"></div>
|
||||||
|
</main>
|
||||||
|
<div id="printcontainerDE_bottom" lang="de"><input type="button" value="🖶 Antrag drucken" id="printDE_bottom" disabled></div>
|
||||||
|
<div id="printcontainerEN_bottom" lang="en"><input type="button" value="🖶 Print" id="printEN_bottom" disabled></div>
|
||||||
|
<template id="neuerEintrag">
|
||||||
|
<tr style="display: none">
|
||||||
|
<td style="text-align: right;"></td>
|
||||||
|
<td><textarea style="resize:both;" cols="45" rows="2" placeholder="Please enter a description of this expense here."></textarea></td>
|
||||||
|
<td><input type="date"></td>
|
||||||
|
<td style="text-align:right;"><input type="number" min="0.00" max="10000.00" step="0.01" value="0.00" style="text-align: right;"></td>
|
||||||
|
<td class="delete"><button class="delbutton">-</button></td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
<footer>
|
||||||
|
<a href="mailto:info@wikimedia.de">Kontakt / contact</a>
|
||||||
|
<p>© 2016 by Wikimedia Deutschland e.V.</p>
|
||||||
|
<address>Wikimedia Deutschland<br>
|
||||||
|
Gesellschaft zur Förderung Freien Wissens e.V.<br>
|
||||||
|
Postfach 61 03 49<br>
|
||||||
|
10925 Berlin<br><br>
|
||||||
|
|
||||||
|
http://wikimedia.de<br>
|
||||||
|
Tel: +49 30/21 91 58 26-0<br>
|
||||||
|
Fax: +49 30/21 91 58 26-9<br>
|
||||||
|
E-Mail: info@wikimedia.de<br><br>
|
||||||
|
|
||||||
|
</address>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
39
PHPMailer/Exception.php
Normal file
39
PHPMailer/Exception.php
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHPMailer Exception class.
|
||||||
|
* PHP Version 5.5.
|
||||||
|
*
|
||||||
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
|
*
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
* @author Brent R. Matzelle (original founder)
|
||||||
|
* @copyright 2012 - 2017 Marcus Bointon
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHPMailer exception handler.
|
||||||
|
*
|
||||||
|
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||||
|
*/
|
||||||
|
class Exception extends \Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Prettify error message output.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage()
|
||||||
|
{
|
||||||
|
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
|
||||||
|
}
|
||||||
|
}
|
138
PHPMailer/OAuth.php
Normal file
138
PHPMailer/OAuth.php
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHPMailer - PHP email creation and transport class.
|
||||||
|
* PHP Version 5.5.
|
||||||
|
*
|
||||||
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
|
*
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
* @author Brent R. Matzelle (original founder)
|
||||||
|
* @copyright 2012 - 2015 Marcus Bointon
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
|
use League\OAuth2\Client\Grant\RefreshToken;
|
||||||
|
use League\OAuth2\Client\Provider\AbstractProvider;
|
||||||
|
use League\OAuth2\Client\Token\AccessToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OAuth - OAuth2 authentication wrapper class.
|
||||||
|
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
||||||
|
*
|
||||||
|
* @see http://oauth2-client.thephpleague.com
|
||||||
|
*
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
*/
|
||||||
|
class OAuth
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* An instance of the League OAuth Client Provider.
|
||||||
|
*
|
||||||
|
* @var AbstractProvider
|
||||||
|
*/
|
||||||
|
protected $provider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current OAuth access token.
|
||||||
|
*
|
||||||
|
* @var AccessToken
|
||||||
|
*/
|
||||||
|
protected $oauthToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The user's email address, usually used as the login ID
|
||||||
|
* and also the from address when sending email.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $oauthUserEmail = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The client secret, generated in the app definition of the service you're connecting to.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $oauthClientSecret = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The client ID, generated in the app definition of the service you're connecting to.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $oauthClientId = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The refresh token, used to obtain new AccessTokens.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $oauthRefreshToken = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OAuth constructor.
|
||||||
|
*
|
||||||
|
* @param array $options Associative array containing
|
||||||
|
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
|
||||||
|
*/
|
||||||
|
public function __construct($options)
|
||||||
|
{
|
||||||
|
$this->provider = $options['provider'];
|
||||||
|
$this->oauthUserEmail = $options['userName'];
|
||||||
|
$this->oauthClientSecret = $options['clientSecret'];
|
||||||
|
$this->oauthClientId = $options['clientId'];
|
||||||
|
$this->oauthRefreshToken = $options['refreshToken'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a new RefreshToken.
|
||||||
|
*
|
||||||
|
* @return RefreshToken
|
||||||
|
*/
|
||||||
|
protected function getGrant()
|
||||||
|
{
|
||||||
|
return new RefreshToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a new AccessToken.
|
||||||
|
*
|
||||||
|
* @return AccessToken
|
||||||
|
*/
|
||||||
|
protected function getToken()
|
||||||
|
{
|
||||||
|
return $this->provider->getAccessToken(
|
||||||
|
$this->getGrant(),
|
||||||
|
['refresh_token' => $this->oauthRefreshToken]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a base64-encoded OAuth token.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getOauth64()
|
||||||
|
{
|
||||||
|
// Get a new token if it's not available or has expired
|
||||||
|
if (null === $this->oauthToken || $this->oauthToken->hasExpired()) {
|
||||||
|
$this->oauthToken = $this->getToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
return base64_encode(
|
||||||
|
'user=' .
|
||||||
|
$this->oauthUserEmail .
|
||||||
|
"\001auth=Bearer " .
|
||||||
|
$this->oauthToken .
|
||||||
|
"\001\001"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
4820
PHPMailer/PHPMailer.php
Normal file
4820
PHPMailer/PHPMailer.php
Normal file
File diff suppressed because it is too large
Load diff
421
PHPMailer/POP3.php
Normal file
421
PHPMailer/POP3.php
Normal file
|
@ -0,0 +1,421 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHPMailer POP-Before-SMTP Authentication Class.
|
||||||
|
* PHP Version 5.5.
|
||||||
|
*
|
||||||
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
|
*
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
* @author Brent R. Matzelle (original founder)
|
||||||
|
* @copyright 2012 - 2019 Marcus Bointon
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHPMailer POP-Before-SMTP Authentication Class.
|
||||||
|
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
|
||||||
|
* 1) This class does not support APOP authentication.
|
||||||
|
* 2) Opening and closing lots of POP3 connections can be quite slow. If you need
|
||||||
|
* to send a batch of emails then just perform the authentication once at the start,
|
||||||
|
* and then loop through your mail sending script. Providing this process doesn't
|
||||||
|
* take longer than the verification period lasts on your POP3 server, you should be fine.
|
||||||
|
* 3) This is really ancient technology; you should only need to use it to talk to very old systems.
|
||||||
|
* 4) This POP3 class is deliberately lightweight and incomplete, implementing just
|
||||||
|
* enough to do authentication.
|
||||||
|
* If you want a more complete class there are other POP3 classes for PHP available.
|
||||||
|
*
|
||||||
|
* @author Richard Davey (original author) <rich@corephp.co.uk>
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
class POP3
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The POP3 PHPMailer Version number.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const VERSION = '6.1.4';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default POP3 port number.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
const DEFAULT_PORT = 110;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default timeout in seconds.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
const DEFAULT_TIMEOUT = 30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debug display level.
|
||||||
|
* Options: 0 = no, 1+ = yes.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $do_debug = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 mail server hostname.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 port number.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 Timeout Value in seconds.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $tval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 username.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 password.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource handle for the POP3 connection socket.
|
||||||
|
*
|
||||||
|
* @var resource
|
||||||
|
*/
|
||||||
|
protected $pop_conn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are we connected?
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $connected = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Error container.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $errors = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Line break constant.
|
||||||
|
*/
|
||||||
|
const LE = "\r\n";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple static wrapper for all-in-one POP before SMTP.
|
||||||
|
*
|
||||||
|
* @param string $host The hostname to connect to
|
||||||
|
* @param int|bool $port The port number to connect to
|
||||||
|
* @param int|bool $timeout The timeout value
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param int $debug_level
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function popBeforeSmtp(
|
||||||
|
$host,
|
||||||
|
$port = false,
|
||||||
|
$timeout = false,
|
||||||
|
$username = '',
|
||||||
|
$password = '',
|
||||||
|
$debug_level = 0
|
||||||
|
) {
|
||||||
|
$pop = new self();
|
||||||
|
|
||||||
|
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authenticate with a POP3 server.
|
||||||
|
* A connect, login, disconnect sequence
|
||||||
|
* appropriate for POP-before SMTP authorisation.
|
||||||
|
*
|
||||||
|
* @param string $host The hostname to connect to
|
||||||
|
* @param int|bool $port The port number to connect to
|
||||||
|
* @param int|bool $timeout The timeout value
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param int $debug_level
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
||||||
|
{
|
||||||
|
$this->host = $host;
|
||||||
|
// If no port value provided, use default
|
||||||
|
if (false === $port) {
|
||||||
|
$this->port = static::DEFAULT_PORT;
|
||||||
|
} else {
|
||||||
|
$this->port = (int) $port;
|
||||||
|
}
|
||||||
|
// If no timeout value provided, use default
|
||||||
|
if (false === $timeout) {
|
||||||
|
$this->tval = static::DEFAULT_TIMEOUT;
|
||||||
|
} else {
|
||||||
|
$this->tval = (int) $timeout;
|
||||||
|
}
|
||||||
|
$this->do_debug = $debug_level;
|
||||||
|
$this->username = $username;
|
||||||
|
$this->password = $password;
|
||||||
|
// Reset the error log
|
||||||
|
$this->errors = [];
|
||||||
|
// connect
|
||||||
|
$result = $this->connect($this->host, $this->port, $this->tval);
|
||||||
|
if ($result) {
|
||||||
|
$login_result = $this->login($this->username, $this->password);
|
||||||
|
if ($login_result) {
|
||||||
|
$this->disconnect();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// We need to disconnect regardless of whether the login succeeded
|
||||||
|
$this->disconnect();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect to a POP3 server.
|
||||||
|
*
|
||||||
|
* @param string $host
|
||||||
|
* @param int|bool $port
|
||||||
|
* @param int $tval
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function connect($host, $port = false, $tval = 30)
|
||||||
|
{
|
||||||
|
// Are we already connected?
|
||||||
|
if ($this->connected) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
||||||
|
//Rather than suppress it with @fsockopen, capture it cleanly instead
|
||||||
|
set_error_handler([$this, 'catchWarning']);
|
||||||
|
|
||||||
|
if (false === $port) {
|
||||||
|
$port = static::DEFAULT_PORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// connect to the POP3 server
|
||||||
|
$errno = 0;
|
||||||
|
$errstr = '';
|
||||||
|
$this->pop_conn = fsockopen(
|
||||||
|
$host, // POP3 Host
|
||||||
|
$port, // Port #
|
||||||
|
$errno, // Error Number
|
||||||
|
$errstr, // Error Message
|
||||||
|
$tval
|
||||||
|
); // Timeout (seconds)
|
||||||
|
// Restore the error handler
|
||||||
|
restore_error_handler();
|
||||||
|
|
||||||
|
// Did we connect?
|
||||||
|
if (false === $this->pop_conn) {
|
||||||
|
// It would appear not...
|
||||||
|
$this->setError(
|
||||||
|
"Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
|
||||||
|
);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Increase the stream time-out
|
||||||
|
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||||
|
|
||||||
|
// Get the POP3 server response
|
||||||
|
$pop3_response = $this->getResponse();
|
||||||
|
// Check for the +OK
|
||||||
|
if ($this->checkResponse($pop3_response)) {
|
||||||
|
// The connection is established and the POP3 server is talking
|
||||||
|
$this->connected = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log in to the POP3 server.
|
||||||
|
* Does not support APOP (RFC 2828, 4949).
|
||||||
|
*
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function login($username = '', $password = '')
|
||||||
|
{
|
||||||
|
if (!$this->connected) {
|
||||||
|
$this->setError('Not connected to POP3 server');
|
||||||
|
}
|
||||||
|
if (empty($username)) {
|
||||||
|
$username = $this->username;
|
||||||
|
}
|
||||||
|
if (empty($password)) {
|
||||||
|
$password = $this->password;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send the Username
|
||||||
|
$this->sendString("USER $username" . static::LE);
|
||||||
|
$pop3_response = $this->getResponse();
|
||||||
|
if ($this->checkResponse($pop3_response)) {
|
||||||
|
// Send the Password
|
||||||
|
$this->sendString("PASS $password" . static::LE);
|
||||||
|
$pop3_response = $this->getResponse();
|
||||||
|
if ($this->checkResponse($pop3_response)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnect from the POP3 server.
|
||||||
|
*/
|
||||||
|
public function disconnect()
|
||||||
|
{
|
||||||
|
$this->sendString('QUIT');
|
||||||
|
//The QUIT command may cause the daemon to exit, which will kill our connection
|
||||||
|
//So ignore errors here
|
||||||
|
try {
|
||||||
|
@fclose($this->pop_conn);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a response from the POP3 server.
|
||||||
|
*
|
||||||
|
* @param int $size The maximum number of bytes to retrieve
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function getResponse($size = 128)
|
||||||
|
{
|
||||||
|
$response = fgets($this->pop_conn, $size);
|
||||||
|
if ($this->do_debug >= 1) {
|
||||||
|
echo 'Server -> Client: ', $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send raw data to the POP3 server.
|
||||||
|
*
|
||||||
|
* @param string $string
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
protected function sendString($string)
|
||||||
|
{
|
||||||
|
if ($this->pop_conn) {
|
||||||
|
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
|
||||||
|
echo 'Client -> Server: ', $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fwrite($this->pop_conn, $string, strlen($string));
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the POP3 server response.
|
||||||
|
* Looks for for +OK or -ERR.
|
||||||
|
*
|
||||||
|
* @param string $string
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function checkResponse($string)
|
||||||
|
{
|
||||||
|
if (strpos($string, '+OK') !== 0) {
|
||||||
|
$this->setError("Server reported an error: $string");
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an error to the internal error store.
|
||||||
|
* Also display debug output if it's enabled.
|
||||||
|
*
|
||||||
|
* @param string $error
|
||||||
|
*/
|
||||||
|
protected function setError($error)
|
||||||
|
{
|
||||||
|
$this->errors[] = $error;
|
||||||
|
if ($this->do_debug >= 1) {
|
||||||
|
echo '<pre>';
|
||||||
|
foreach ($this->errors as $e) {
|
||||||
|
print_r($e);
|
||||||
|
}
|
||||||
|
echo '</pre>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an array of error messages, if any.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getErrors()
|
||||||
|
{
|
||||||
|
return $this->errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 connection error handler.
|
||||||
|
*
|
||||||
|
* @param int $errno
|
||||||
|
* @param string $errstr
|
||||||
|
* @param string $errfile
|
||||||
|
* @param int $errline
|
||||||
|
*/
|
||||||
|
protected function catchWarning($errno, $errstr, $errfile, $errline)
|
||||||
|
{
|
||||||
|
$this->setError(
|
||||||
|
'Connecting to the POP3 server raised a PHP warning:' .
|
||||||
|
"errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
1371
PHPMailer/SMTP.php
Normal file
1371
PHPMailer/SMTP.php
Normal file
File diff suppressed because it is too large
Load diff
17
README.md
Normal file
17
README.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Kostenerstattungsformular
|
||||||
|
|
||||||
|
## INSTALL
|
||||||
|
|
||||||
|
Install the following programs and PHP modules:
|
||||||
|
|
||||||
|
* pdftk
|
||||||
|
* php-session
|
||||||
|
* php-json
|
||||||
|
* php-openssl
|
||||||
|
* php-ctype
|
||||||
|
* php-filter
|
||||||
|
* php-fileinfo
|
||||||
|
|
||||||
|
Copy **config.sample.php** to **config.php**, and edit **config.php** to your needs.
|
||||||
|
|
||||||
|
Tha's it.
|
2961
TCPDF/CHANGELOG.TXT
Normal file
2961
TCPDF/CHANGELOG.TXT
Normal file
File diff suppressed because it is too large
Load diff
860
TCPDF/LICENSE.TXT
Normal file
860
TCPDF/LICENSE.TXT
Normal file
|
@ -0,0 +1,860 @@
|
||||||
|
**********************************************************************
|
||||||
|
* TCPDF LICENSE
|
||||||
|
**********************************************************************
|
||||||
|
|
||||||
|
TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
2002-2019 Nicola Asuni - Tecnick.com LTD
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
**********************************************************************
|
84
TCPDF/README.md
Normal file
84
TCPDF/README.md
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
# TCPDF
|
||||||
|
*PHP PDF Library*
|
||||||
|
|
||||||
|
[![Donate via PayPal](https://img.shields.io/badge/donate-paypal-87ceeb.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)
|
||||||
|
*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)*
|
||||||
|
|
||||||
|
* **category** Library
|
||||||
|
* **author** Nicola Asuni <info@tecnick.com>
|
||||||
|
* **copyright** 2002-2020 Nicola Asuni - Tecnick.com LTD
|
||||||
|
* **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
|
||||||
|
* **link** http://www.tcpdf.org
|
||||||
|
* **source** https://github.com/tecnickcom/TCPDF
|
||||||
|
|
||||||
|
|
||||||
|
## IMPORTANT
|
||||||
|
A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support.
|
||||||
|
This version should be considered obsolete, new projects should use the new version as soon it will become stable.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
PHP library for generating PDF documents on-the-fly.
|
||||||
|
|
||||||
|
### Main Features:
|
||||||
|
* no external libraries are required for the basic functions;
|
||||||
|
* all standard page formats, custom page formats, custom margins and units of measure;
|
||||||
|
* UTF-8 Unicode and Right-To-Left languages;
|
||||||
|
* TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts;
|
||||||
|
* font subsetting;
|
||||||
|
* methods to publish some XHTML + CSS code, Javascript and Forms;
|
||||||
|
* images, graphic (geometric figures) and transformation methods;
|
||||||
|
* supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/script/formats.php)
|
||||||
|
* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;
|
||||||
|
* JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
|
||||||
|
* automatic page header and footer management;
|
||||||
|
* document encryption up to 256 bit and digital signature certifications;
|
||||||
|
* transactions to UNDO commands;
|
||||||
|
* PDF annotations, including links, text and file attachments;
|
||||||
|
* text rendering modes (fill, stroke and clipping);
|
||||||
|
* multiple columns mode;
|
||||||
|
* no-write page regions;
|
||||||
|
* bookmarks, named destinations and table of content;
|
||||||
|
* text hyphenation;
|
||||||
|
* text stretching and spacing (tracking);
|
||||||
|
* automatic page break, line break and text alignments including justification;
|
||||||
|
* automatic page numbering and page groups;
|
||||||
|
* move and delete pages;
|
||||||
|
* page compression (requires php-zlib extension);
|
||||||
|
* XOBject Templates;
|
||||||
|
* Layers and object visibility.
|
||||||
|
* PDF/A-1b support.
|
||||||
|
|
||||||
|
### Third party fonts:
|
||||||
|
|
||||||
|
This library may include third party font files released with different licenses.
|
||||||
|
|
||||||
|
All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3),
|
||||||
|
they do not contain any binary data but just a description of the general properties of a particular font.
|
||||||
|
These files can be also generated on the fly using the font utilities and TCPDF methods.
|
||||||
|
|
||||||
|
All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files).
|
||||||
|
|
||||||
|
The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3).
|
||||||
|
The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license.
|
||||||
|
For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503
|
||||||
|
Link : http://www.gnu.org/software/freefont/
|
||||||
|
|
||||||
|
The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection.
|
||||||
|
For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33
|
||||||
|
Link : http://dejavu-fonts.org
|
||||||
|
|
||||||
|
The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2).
|
||||||
|
Link : http://projects.arabeyes.org/
|
||||||
|
|
||||||
|
### ICC profile:
|
||||||
|
|
||||||
|
TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package:
|
||||||
|
https://packages.debian.org/source/stable/icc-profiles-free
|
||||||
|
|
||||||
|
|
||||||
|
## Developer(s) Contact
|
||||||
|
|
||||||
|
* Nicola Asuni <info@tecnick.com>
|
1
TCPDF/VERSION
Normal file
1
TCPDF/VERSION
Normal file
|
@ -0,0 +1 @@
|
||||||
|
6.3.5
|
47
TCPDF/composer.json
Normal file
47
TCPDF/composer.json
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"name": "tecnickcom/tcpdf",
|
||||||
|
"version": "6.3.5",
|
||||||
|
"homepage": "http://www.tcpdf.org/",
|
||||||
|
"type": "library",
|
||||||
|
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
|
||||||
|
"keywords": [
|
||||||
|
"PDF",
|
||||||
|
"tcpdf",
|
||||||
|
"PDFD32000-2008",
|
||||||
|
"qrcode",
|
||||||
|
"datamatrix",
|
||||||
|
"pdf417",
|
||||||
|
"barcodes"
|
||||||
|
],
|
||||||
|
"license": "LGPL-3.0-only",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicola Asuni",
|
||||||
|
"email": "info@tecnick.com",
|
||||||
|
"role": "lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"config",
|
||||||
|
"include",
|
||||||
|
"tcpdf.php",
|
||||||
|
"tcpdf_parser.php",
|
||||||
|
"tcpdf_import.php",
|
||||||
|
"tcpdf_barcodes_1d.php",
|
||||||
|
"tcpdf_barcodes_2d.php",
|
||||||
|
"include/tcpdf_colors.php",
|
||||||
|
"include/tcpdf_filters.php",
|
||||||
|
"include/tcpdf_font_data.php",
|
||||||
|
"include/tcpdf_fonts.php",
|
||||||
|
"include/tcpdf_images.php",
|
||||||
|
"include/tcpdf_static.php",
|
||||||
|
"include/barcodes/datamatrix.php",
|
||||||
|
"include/barcodes/pdf417.php",
|
||||||
|
"include/barcodes/qrcode.php"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
19
TCPDF/composer.lock
generated
Normal file
19
TCPDF/composer.lock
generated
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "5726aa312f77aee905146d13d6be7179",
|
||||||
|
"packages": [],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"platform-dev": []
|
||||||
|
}
|
227
TCPDF/config/tcpdf_config.php
Normal file
227
TCPDF/config/tcpdf_config.php
Normal file
|
@ -0,0 +1,227 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : tcpdf_config.php
|
||||||
|
// Begin : 2004-06-11
|
||||||
|
// Last Update : 2014-12-11
|
||||||
|
//
|
||||||
|
// Description : Configuration file for TCPDF.
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2004-2014 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration file for TCPDF.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @version 4.9.005
|
||||||
|
* @since 2004-10-27
|
||||||
|
*/
|
||||||
|
|
||||||
|
// IMPORTANT:
|
||||||
|
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored.
|
||||||
|
// If you use the tcpdf_autoconfig.php, then you can overwrite some values here.
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installation path (/var/www/tcpdf/).
|
||||||
|
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_MAIN', '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL path to tcpdf installation folder (http://localhost/tcpdf/).
|
||||||
|
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_URL', '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path for PDF fonts.
|
||||||
|
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default images directory.
|
||||||
|
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_IMAGES', '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deafult image logo used be the default Header() method.
|
||||||
|
* Please set here your own logo or an empty string to disable it.
|
||||||
|
*/
|
||||||
|
//define ('PDF_HEADER_LOGO', '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header logo image width in user units.
|
||||||
|
*/
|
||||||
|
//define ('PDF_HEADER_LOGO_WIDTH', 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cache directory for temporary files (full path).
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_CACHE', '/tmp/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic name for a blank image.
|
||||||
|
*/
|
||||||
|
define ('K_BLANK_IMAGE', '_blank.png');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page format.
|
||||||
|
*/
|
||||||
|
define ('PDF_PAGE_FORMAT', 'A4');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page orientation (P=portrait, L=landscape).
|
||||||
|
*/
|
||||||
|
define ('PDF_PAGE_ORIENTATION', 'P');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document creator.
|
||||||
|
*/
|
||||||
|
define ('PDF_CREATOR', 'TCPDF');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document author.
|
||||||
|
*/
|
||||||
|
define ('PDF_AUTHOR', 'TCPDF');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header title.
|
||||||
|
*/
|
||||||
|
define ('PDF_HEADER_TITLE', 'TCPDF Example');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header description string.
|
||||||
|
*/
|
||||||
|
define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
|
||||||
|
*/
|
||||||
|
define ('PDF_UNIT', 'mm');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_HEADER', 5);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Footer margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_FOOTER', 10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Top margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_TOP', 27);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bottom margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_BOTTOM', 25);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Left margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_LEFT', 15);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Right margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_RIGHT', 15);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default main font name.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_NAME_MAIN', 'helvetica');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default main font size.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_SIZE_MAIN', 10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default data font name.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_NAME_DATA', 'helvetica');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default data font size.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_SIZE_DATA', 8);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default monospaced font name.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_MONOSPACED', 'courier');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ratio used to adjust the conversion of pixels to user units.
|
||||||
|
*/
|
||||||
|
define ('PDF_IMAGE_SCALE_RATIO', 1.25);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magnification factor for titles.
|
||||||
|
*/
|
||||||
|
define('HEAD_MAGNIFICATION', 1.1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Height of cell respect font height.
|
||||||
|
*/
|
||||||
|
define('K_CELL_HEIGHT_RATIO', 1.25);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title magnification respect main font size.
|
||||||
|
*/
|
||||||
|
define('K_TITLE_MAGNIFICATION', 1.3);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reduction factor for small font.
|
||||||
|
*/
|
||||||
|
define('K_SMALL_RATIO', 2/3);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
|
||||||
|
*/
|
||||||
|
define('K_THAI_TOPCHARS', true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true allows to call TCPDF methods using HTML syntax
|
||||||
|
* IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
|
||||||
|
*/
|
||||||
|
define('K_TCPDF_CALLS_IN_HTML', false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
|
||||||
|
*/
|
||||||
|
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default timezone for datetime functions
|
||||||
|
*/
|
||||||
|
define('K_TIMEZONE', 'UTC');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_1d_html.php
Normal file
53
TCPDF/examples/barcodes/example_1d_html.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_1d_html.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.000
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 1D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||||
|
|
||||||
|
// output the barcode as HTML object
|
||||||
|
echo $barcodeobj->getBarcodeHTML(2, 30, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_1d_png.php
Normal file
53
TCPDF/examples/barcodes/example_1d_png.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_1d_png.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.000
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 1D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||||
|
|
||||||
|
// output the barcode as PNG image
|
||||||
|
$barcodeobj->getBarcodePNG(2, 30, array(0,0,0));
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_1d_svg.php
Normal file
53
TCPDF/examples/barcodes/example_1d_svg.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_1d_svg.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.000
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 1D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||||
|
|
||||||
|
// output the barcode as SVG image
|
||||||
|
$barcodeobj->getBarcodeSVG(2, 30, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_1d_svgi.php
Normal file
53
TCPDF/examples/barcodes/example_1d_svgi.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_1d_svgi.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.000
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 1D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_1d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
|
||||||
|
|
||||||
|
// output the barcode as SVG inline code
|
||||||
|
echo $barcodeobj->getBarcodeSVGcode(2, 40, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_datamatrix_html.php
Normal file
53
TCPDF/examples/barcodes/example_2d_datamatrix_html.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_html.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||||
|
|
||||||
|
// output the barcode as HTML object
|
||||||
|
echo $barcodeobj->getBarcodeHTML(6, 6, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_datamatrix_png.php
Normal file
53
TCPDF/examples/barcodes/example_2d_datamatrix_png.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_png.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||||
|
|
||||||
|
// output the barcode as PNG image
|
||||||
|
$barcodeobj->getBarcodePNG(6, 6, array(0,0,0));
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_datamatrix_svg.php
Normal file
53
TCPDF/examples/barcodes/example_2d_datamatrix_svg.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_svg.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||||
|
|
||||||
|
// output the barcode as SVG image
|
||||||
|
$barcodeobj->getBarcodeSVG(6, 6, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_datamatrix_svgi.php
Normal file
53
TCPDF/examples/barcodes/example_2d_datamatrix_svgi.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_svgi.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'DATAMATRIX');
|
||||||
|
|
||||||
|
// output the barcode as SVG inline code
|
||||||
|
echo $barcodeobj->getBarcodeSVGcode(6, 6, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_pdf417_html.php
Normal file
53
TCPDF/examples/barcodes/example_2d_pdf417_html.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_html.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||||
|
|
||||||
|
// output the barcode as HTML object
|
||||||
|
echo $barcodeobj->getBarcodeHTML(4, 4, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_pdf417_png.php
Normal file
53
TCPDF/examples/barcodes/example_2d_pdf417_png.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_png.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||||
|
|
||||||
|
// output the barcode as PNG image
|
||||||
|
$barcodeobj->getBarcodePNG(4, 4, array(0,0,0));
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_pdf417_svg.php
Normal file
53
TCPDF/examples/barcodes/example_2d_pdf417_svg.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_svg.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||||
|
|
||||||
|
// output the barcode as SVG image
|
||||||
|
$barcodeobj->getBarcodeSVG(4, 4, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_pdf417_svgi.php
Normal file
53
TCPDF/examples/barcodes/example_2d_pdf417_svgi.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_svgi.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417');
|
||||||
|
|
||||||
|
// output the barcode as SVG inline code
|
||||||
|
echo $barcodeobj->getBarcodeSVGcode(4, 4, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_qrcode_html.php
Normal file
53
TCPDF/examples/barcodes/example_2d_qrcode_html.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_html.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||||
|
|
||||||
|
// output the barcode as HTML object
|
||||||
|
echo $barcodeobj->getBarcodeHTML(6, 6, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_qrcode_png.php
Normal file
53
TCPDF/examples/barcodes/example_2d_qrcode_png.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_png.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||||
|
|
||||||
|
// output the barcode as PNG image
|
||||||
|
$barcodeobj->getBarcodePNG(6, 6, array(0,0,0));
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_qrcode_svg.php
Normal file
53
TCPDF/examples/barcodes/example_2d_qrcode_svg.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_svg.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||||
|
|
||||||
|
// output the barcode as SVG image
|
||||||
|
$barcodeobj->getBarcodeSVG(6, 6, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
53
TCPDF/examples/barcodes/example_2d_qrcode_svgi.php
Normal file
53
TCPDF/examples/barcodes/example_2d_qrcode_svgi.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_2d_svgi.php
|
||||||
|
// Version : 1.0.000
|
||||||
|
// Begin : 2011-07-21
|
||||||
|
// Last Update : 2013-03-19
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2009-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description : Example for tcpdf_barcodes_2d.php class
|
||||||
|
//
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Example for tcpdf_barcodes_2d.php class
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @version 1.0.009
|
||||||
|
*/
|
||||||
|
|
||||||
|
// include 2D barcode class (search for installation path)
|
||||||
|
require_once(dirname(__FILE__).'/tcpdf_barcodes_2d_include.php');
|
||||||
|
|
||||||
|
// set the barcode content and type
|
||||||
|
$barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H');
|
||||||
|
|
||||||
|
// output the barcode as SVG inline code
|
||||||
|
echo $barcodeobj->getBarcodeSVGcode(6, 6, 'black');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
37
TCPDF/examples/barcodes/tcpdf_barcodes_1d_include.php
Normal file
37
TCPDF/examples/barcodes/tcpdf_barcodes_1d_include.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : tcpdf_barcodes_1d_include.php
|
||||||
|
// Begin : 2013-05-19
|
||||||
|
// Last Update : 2013-05-19
|
||||||
|
//
|
||||||
|
// Description : Search and include the TCPDF Barcode 1D class.
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search and include the TCPDF Barcode 1D class.
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Include the main class.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2013-05-19
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the TCPDF 1D barcode class (search the class on the following directories).
|
||||||
|
$tcpdf_barcodes_1d_include_dirs = array(realpath('../../tcpdf_barcodes_1d.php'), '/usr/share/php/tcpdf/tcpdf_barcodes_1d.php', '/usr/share/tcpdf/tcpdf_barcodes_1d.php', '/usr/share/php-tcpdf/tcpdf_barcodes_1d.php', '/var/www/tcpdf/tcpdf_barcodes_1d.php', '/var/www/html/tcpdf/tcpdf_barcodes_1d.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_1d.php');
|
||||||
|
foreach ($tcpdf_barcodes_1d_include_dirs as $tcpdf_barcodes_1d_include_path) {
|
||||||
|
if (@file_exists($tcpdf_barcodes_1d_include_path)) {
|
||||||
|
require_once($tcpdf_barcodes_1d_include_path);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
37
TCPDF/examples/barcodes/tcpdf_barcodes_2d_include.php
Normal file
37
TCPDF/examples/barcodes/tcpdf_barcodes_2d_include.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : tcpdf_barcodes_2d_include.php
|
||||||
|
// Begin : 2013-05-19
|
||||||
|
// Last Update : 2013-05-19
|
||||||
|
//
|
||||||
|
// Description : Search and include the TCPDF Barcode 1D class.
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search and include the TCPDF Barcode 2D class.
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Include the main class.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2013-05-19
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the TCPDF 2D barcode class (search the class on the following directories).
|
||||||
|
$tcpdf_barcodes_2d_include_dirs = array(realpath('../../tcpdf_barcodes_2d.php'), '/usr/share/php/tcpdf/tcpdf_barcodes_2d.php', '/usr/share/tcpdf/tcpdf_barcodes_2d.php', '/usr/share/php-tcpdf/tcpdf_barcodes_2d.php', '/var/www/tcpdf/tcpdf_barcodes_2d.php', '/var/www/html/tcpdf/tcpdf_barcodes_2d.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_2d.php');
|
||||||
|
foreach ($tcpdf_barcodes_2d_include_dirs as $tcpdf_barcodes_2d_include_path) {
|
||||||
|
if (@file_exists($tcpdf_barcodes_2d_include_path)) {
|
||||||
|
require_once($tcpdf_barcodes_2d_include_path);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
222
TCPDF/examples/config/tcpdf_config_alt.php
Normal file
222
TCPDF/examples/config/tcpdf_config_alt.php
Normal file
|
@ -0,0 +1,222 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : tcpdf_config.php
|
||||||
|
// Begin : 2004-06-11
|
||||||
|
// Last Update : 2013-05-16
|
||||||
|
//
|
||||||
|
// Description : Example of alternative configuration file for TCPDF.
|
||||||
|
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||||
|
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
|
//
|
||||||
|
// This file is part of TCPDF software library.
|
||||||
|
//
|
||||||
|
// TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
// under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// TCPDF is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
// See the GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// See LICENSE.TXT file for more information.
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example of alternative configuration file for TCPDF.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @version 4.9.005
|
||||||
|
* @since 2004-10-27
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the following constant to ignore the default configuration file.
|
||||||
|
*/
|
||||||
|
define ('K_TCPDF_EXTERNAL_CONFIG', true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installation path (/var/www/tcpdf/).
|
||||||
|
* By default it is automatically calculated but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_MAIN', '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL path to tcpdf installation folder (http://localhost/tcpdf/).
|
||||||
|
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_URL', '');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path for PDF fonts.
|
||||||
|
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default images directory.
|
||||||
|
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
||||||
|
*/
|
||||||
|
define ('K_PATH_IMAGES', dirname(__FILE__).'/../images/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deafult image logo used be the default Header() method.
|
||||||
|
* Please set here your own logo or an empty string to disable it.
|
||||||
|
*/
|
||||||
|
define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header logo image width in user units.
|
||||||
|
*/
|
||||||
|
define ('PDF_HEADER_LOGO_WIDTH', 30);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cache directory for temporary files (full path).
|
||||||
|
*/
|
||||||
|
define ('K_PATH_CACHE', sys_get_temp_dir().'/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic name for a blank image.
|
||||||
|
*/
|
||||||
|
define ('K_BLANK_IMAGE', '_blank.png');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page format.
|
||||||
|
*/
|
||||||
|
define ('PDF_PAGE_FORMAT', 'A4');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page orientation (P=portrait, L=landscape).
|
||||||
|
*/
|
||||||
|
define ('PDF_PAGE_ORIENTATION', 'P');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document creator.
|
||||||
|
*/
|
||||||
|
define ('PDF_CREATOR', 'TCPDF');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document author.
|
||||||
|
*/
|
||||||
|
define ('PDF_AUTHOR', 'TCPDF');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header title.
|
||||||
|
*/
|
||||||
|
define ('PDF_HEADER_TITLE', 'TCPDF Example');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header description string.
|
||||||
|
*/
|
||||||
|
define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
|
||||||
|
*/
|
||||||
|
define ('PDF_UNIT', 'mm');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_HEADER', 5);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Footer margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_FOOTER', 10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Top margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_TOP', 27);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bottom margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_BOTTOM', 25);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Left margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_LEFT', 15);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Right margin.
|
||||||
|
*/
|
||||||
|
define ('PDF_MARGIN_RIGHT', 15);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default main font name.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_NAME_MAIN', 'helvetica');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default main font size.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_SIZE_MAIN', 10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default data font name.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_NAME_DATA', 'helvetica');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default data font size.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_SIZE_DATA', 8);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default monospaced font name.
|
||||||
|
*/
|
||||||
|
define ('PDF_FONT_MONOSPACED', 'courier');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ratio used to adjust the conversion of pixels to user units.
|
||||||
|
*/
|
||||||
|
define ('PDF_IMAGE_SCALE_RATIO', 1.25);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magnification factor for titles.
|
||||||
|
*/
|
||||||
|
define('HEAD_MAGNIFICATION', 1.1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Height of cell respect font height.
|
||||||
|
*/
|
||||||
|
define('K_CELL_HEIGHT_RATIO', 1.25);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title magnification respect main font size.
|
||||||
|
*/
|
||||||
|
define('K_TITLE_MAGNIFICATION', 1.3);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reduction factor for small font.
|
||||||
|
*/
|
||||||
|
define('K_SMALL_RATIO', 2/3);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
|
||||||
|
*/
|
||||||
|
define('K_THAI_TOPCHARS', true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true allows to call TCPDF methods using HTML syntax
|
||||||
|
* IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
|
||||||
|
*/
|
||||||
|
define('K_TCPDF_CALLS_IN_HTML', true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
|
||||||
|
*/
|
||||||
|
define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
40
TCPDF/examples/data/cert/tcpdf.crt
Normal file
40
TCPDF/examples/data/cert/tcpdf.crt
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
Bag Attributes
|
||||||
|
localKeyID: 7B AB 1B 7A BE 4C 85 C0 1A A6 DC 59 3F 79 48 C3 93 38 68 9C
|
||||||
|
subject=/CN=TCPDF DEMO/O=TCPDF/OU=DEMO/emailAddress=you@example.com/C=IT
|
||||||
|
issuer=/CN=TCPDF DEMO/O=TCPDF/OU=DEMO/emailAddress=you@example.com/C=IT
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIC1TCCAj6gAwIBAgIKkehOL/XGkB5cjjANBgkqhkiG9w0BAQUFADBhMRMwEQYD
|
||||||
|
VQQDEwpUQ1BERiBERU1PMQ4wDAYDVQQKEwVUQ1BERjENMAsGA1UECxMEREVNTzEe
|
||||||
|
MBwGCSqGSIb3DQEJARYPeW91QGV4YW1wbGUuY29tMQswCQYDVQQGEwJJVDAeFw0w
|
||||||
|
OTA4MjExMjU0NDhaFw0xNDA4MjExMjU0NDhaMGExEzARBgNVBAMTClRDUERGIERF
|
||||||
|
TU8xDjAMBgNVBAoTBVRDUERGMQ0wCwYDVQQLEwRERU1PMR4wHAYJKoZIhvcNAQkB
|
||||||
|
Fg95b3VAZXhhbXBsZS5jb20xCzAJBgNVBAYTAklUMIGfMA0GCSqGSIb3DQEBAQUA
|
||||||
|
A4GNADCBiQKBgQDAqIL0uGKmTR98Lxx2vEEE1OGKkMXFo0JViitALe7Onhxxqx0H
|
||||||
|
XMUDKF5mvEVu1rcvh7/oAnAfrCuEpL/up3u1mQCgBE7WXBnFFE/AE3jCksh9OkS0
|
||||||
|
Z0Xj9woN5bzxRDsGoPiOu/4xzk5qSEXt8jf2Ep90QuNkqLIRT4swAzpDbwIDAQAB
|
||||||
|
o4GTMIGQMDcGA1UdEgQwMC6gEQYDVQQDDApUQ1BERiBERU1PoAwGA1UECgwFVENQ
|
||||||
|
REagCwYDVQQLDARERU1PMDcGA1UdEQQwMC6gEQYDVQQDDApUQ1BERiBERU1PoAwG
|
||||||
|
A1UECgwFVENQREagCwYDVQQLDARERU1PMA8GCSqGSIb3LwEBCgQCBQAwCwYDVR0P
|
||||||
|
BAQDAgSQMA0GCSqGSIb3DQEBBQUAA4GBAEhTQfqX3ZNdHmpTLDbIj22RHXii2roE
|
||||||
|
OavCbu9WsHoWpva0qSd+yIoD594VHvYAd29sfzDfiN+7W0aiZfDhq5jpaSQMVlN8
|
||||||
|
RGYMupbHY/+a9Gz1wqxnR84mlTtIkZVRYAhsfPwy6M1BEjdMqfdh9h40JIdkdjtb
|
||||||
|
8faTCfXPePWQ
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
Bag Attributes
|
||||||
|
localKeyID: 7B AB 1B 7A BE 4C 85 C0 1A A6 DC 59 3F 79 48 C3 93 38 68 9C
|
||||||
|
Key Attributes: <No Attributes>
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIICXQIBAAKBgQDAqIL0uGKmTR98Lxx2vEEE1OGKkMXFo0JViitALe7Onhxxqx0H
|
||||||
|
XMUDKF5mvEVu1rcvh7/oAnAfrCuEpL/up3u1mQCgBE7WXBnFFE/AE3jCksh9OkS0
|
||||||
|
Z0Xj9woN5bzxRDsGoPiOu/4xzk5qSEXt8jf2Ep90QuNkqLIRT4swAzpDbwIDAQAB
|
||||||
|
AoGAXc+wNMmz/5Z+RlIKYia44klmqbplEx+0JULqXI4BQsrqvs67i+I4bJkznoL+
|
||||||
|
rEIRYSuQ3sCRKFsFtckjTGpxadnxkB+uwGKc6pZChv99BFX6HFR4hgBlT/BBRAQA
|
||||||
|
hMDlM2JIRr4S4SMVXR7MHwGMUf9mUeanGLR3ZWtU3aXJrIECQQD7OaYUVYNEEnM9
|
||||||
|
uXyjm22CuHyqyEf5gb13sK0uQty67547yJTMUQZd/sQc9KGwhzBbhrob2LO2jAhh
|
||||||
|
S+f+NSRnAkEAxFHm3fMI5RgXmswxlGm4QW07a/Ueo7ZJG6xjTkFXluJhd+XHswRD
|
||||||
|
dQIO3zG9nGjNUoeMrPhXhPvKqFc2F9RDuQJAQBEGin74N77gxqfr4ik79y8nE8J5
|
||||||
|
oGZ2s/RJZdfFRKLg3mwbjjNHhWb4Ck5UgZkoOt8TzRApXG8/n9hktE5HFwJBALur
|
||||||
|
M5AueO1Pl5kB489lNJ9OxUQRYUXMxpxuscuoCQwSwmv0O2+0/qtG2WKhUQnI4aYo
|
||||||
|
L+FV0YwtivBb1jj3T/kCQQDIWOxq8eRowdaMzvJpRUHFgMcf1AVZExKyrugwYOWd
|
||||||
|
KNsDxC4KaQOsPt8iT/Ulo4g/MJC0HolCOhWibKmR9Ayl
|
||||||
|
-----END RSA PRIVATE KEY-----
|
BIN
TCPDF/examples/data/cert/tcpdf.fdf
Normal file
BIN
TCPDF/examples/data/cert/tcpdf.fdf
Normal file
Binary file not shown.
BIN
TCPDF/examples/data/cert/tcpdf.p12
Normal file
BIN
TCPDF/examples/data/cert/tcpdf.p12
Normal file
Binary file not shown.
19
TCPDF/examples/data/chapter_demo_1.txt
Normal file
19
TCPDF/examples/data/chapter_demo_1.txt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
|
||||||
|
|
||||||
|
Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.
|
||||||
|
|
||||||
|
Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.
|
||||||
|
|
||||||
|
Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.
|
||||||
|
|
||||||
|
Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.
|
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
|
||||||
|
|
||||||
|
Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.
|
||||||
|
|
||||||
|
Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.
|
||||||
|
|
||||||
|
Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.
|
||||||
|
|
||||||
|
Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.
|
23
TCPDF/examples/data/chapter_demo_2.txt
Normal file
23
TCPDF/examples/data/chapter_demo_2.txt
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<p><strong>Lorem ipsum</strong> dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.</p>
|
||||||
|
|
||||||
|
<img src="images/image_demo.jpg" width="54mm" height="80mm" />
|
||||||
|
|
||||||
|
<p style="background-color:yellow;"><i>Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.</i></p>
|
||||||
|
|
||||||
|
<p>Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.</p>
|
||||||
|
|
||||||
|
<p style="color:navy;">Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.</p>
|
||||||
|
|
||||||
|
<p>Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.</p>
|
||||||
|
|
||||||
|
<p><strong>Lorem ipsum</strong> dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.</p>
|
||||||
|
|
||||||
|
<img src="images/image_demo.jpg" width="54mm" height="80mm" />
|
||||||
|
|
||||||
|
<p style="background-color:yellow;"><i>Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.</i></p>
|
||||||
|
|
||||||
|
<p>Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.</p>
|
||||||
|
|
||||||
|
<p style="color:navy;">Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.</p>
|
||||||
|
|
||||||
|
<p>Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.</p>
|
15
TCPDF/examples/data/table_data_demo.txt
Normal file
15
TCPDF/examples/data/table_data_demo.txt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Austria;Vienna;83859;8075
|
||||||
|
Belgium;Brussels;30518;10192
|
||||||
|
Denmark;Copenhagen;43094;5295
|
||||||
|
Finland;Helsinki;304529;5147
|
||||||
|
France;Paris;543965;58728
|
||||||
|
Germany;Berlin;357022;82057
|
||||||
|
Greece;Athens;131625;10511
|
||||||
|
Ireland;Dublin;70723;3694
|
||||||
|
Italy;Roma;301316;57563
|
||||||
|
Luxembourg;Luxembourg;2586;424
|
||||||
|
Netherlands;Amsterdam;41526;15654
|
||||||
|
Portugal;Lisbon;91906;9957
|
||||||
|
Spain;Madrid;504790;39348
|
||||||
|
Sweden;Stockholm;410934;8839
|
||||||
|
United Kingdom;London;243820;58862
|
128
TCPDF/examples/data/utf8test.txt
Normal file
128
TCPDF/examples/data/utf8test.txt
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
Sentences that contain all letters commonly used in a language
|
||||||
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
This file is UTF-8 encoded.
|
||||||
|
|
||||||
|
Czech (cz)
|
||||||
|
---------
|
||||||
|
|
||||||
|
Příšerně žluťoučký kůň úpěl ďábelské ódy.
|
||||||
|
Hleď, toť přízračný kůň v mátožné póze šíleně úpí.
|
||||||
|
Zvlášť zákeřný učeň s ďolíčky běží podél zóny úlů.
|
||||||
|
Loď čeří kýlem tůň obzvlášť v Grónské úžině.
|
||||||
|
Ó, náhlý déšť již zvířil prach a čilá laň teď běží s houfcem gazel k úkrytům.
|
||||||
|
|
||||||
|
Danish (da)
|
||||||
|
---------
|
||||||
|
|
||||||
|
Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen
|
||||||
|
Wolther spillede på xylofon.
|
||||||
|
(= Quiz contestants were eating strawbery with cream while Wolther
|
||||||
|
the circus clown played on xylophone.)
|
||||||
|
|
||||||
|
German (de)
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Falsches Üben von Xylophonmusik quält jeden größeren Zwerg
|
||||||
|
(= Wrongful practicing of xylophone music tortures every larger dwarf)
|
||||||
|
|
||||||
|
Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich
|
||||||
|
(= Twelve boxing fighters hunted Eva across the dike of Sylt)
|
||||||
|
|
||||||
|
Heizölrückstoßabdämpfung
|
||||||
|
(= fuel oil recoil absorber)
|
||||||
|
(jqvwxy missing, but all non-ASCII letters in one word)
|
||||||
|
|
||||||
|
English (en)
|
||||||
|
------------
|
||||||
|
|
||||||
|
The quick brown fox jumps over the lazy dog
|
||||||
|
|
||||||
|
Spanish (es)
|
||||||
|
------------
|
||||||
|
|
||||||
|
El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y
|
||||||
|
frío, añoraba a su querido cachorro.
|
||||||
|
(Contains every letter and every accent, but not every combination
|
||||||
|
of vowel + acute.)
|
||||||
|
|
||||||
|
French (fr)
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à
|
||||||
|
côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce
|
||||||
|
qui lui permet de penser à la cænogenèse de l'être dont il est question
|
||||||
|
dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui,
|
||||||
|
pense-t-il, diminue çà et là la qualité de son œuvre.
|
||||||
|
|
||||||
|
l'île exiguë
|
||||||
|
Où l'obèse jury mûr
|
||||||
|
Fête l'haï volapük,
|
||||||
|
Âne ex aéquo au whist,
|
||||||
|
Ôtez ce vœu déçu.
|
||||||
|
|
||||||
|
Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en
|
||||||
|
canoë au delà des îles, près du mälström où brûlent les novæ.
|
||||||
|
|
||||||
|
Irish Gaelic (ga)
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh
|
||||||
|
|
||||||
|
Hungarian (hu)
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Árvíztűrő tükörfúrógép
|
||||||
|
(= flood-proof mirror-drilling machine, only all non-ASCII letters)
|
||||||
|
|
||||||
|
Icelandic (is)
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa
|
||||||
|
|
||||||
|
Sævör grét áðan því úlpan var ónýt
|
||||||
|
(some ASCII letters missing)
|
||||||
|
|
||||||
|
Greek (el)
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο
|
||||||
|
(= No more shall I see acacias or myrtles in the golden clearing)
|
||||||
|
|
||||||
|
Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία
|
||||||
|
(= I uncover the soul-destroying abhorrence)
|
||||||
|
|
||||||
|
Hebrew (iw)
|
||||||
|
-----------
|
||||||
|
|
||||||
|
? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה
|
||||||
|
|
||||||
|
Polish (pl)
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Pchnąć w tę łódź jeża lub osiem skrzyń fig
|
||||||
|
(= To push a hedgehog or eight bins of figs in this boat)
|
||||||
|
|
||||||
|
Zażółć gęślą jaźń
|
||||||
|
|
||||||
|
Russian (ru)
|
||||||
|
------------
|
||||||
|
|
||||||
|
В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
||||||
|
(= Would a citrus live in the bushes of south? Yes, but only a fake one!)
|
||||||
|
|
||||||
|
Thai (th)
|
||||||
|
---------
|
||||||
|
|
||||||
|
[--------------------------|------------------------]
|
||||||
|
๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน
|
||||||
|
จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร
|
||||||
|
ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย
|
||||||
|
ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ
|
||||||
|
|
||||||
|
[The copyright for the Thai example is owned by The Computer
|
||||||
|
Association of Thailand under the Royal Patronage of His Majesty the
|
||||||
|
King.]
|
||||||
|
|
||||||
|
Please let me know if you find others! Special thanks to the people
|
||||||
|
from all over the world who contributed these sentences.
|
106
TCPDF/examples/example_001.php
Normal file
106
TCPDF/examples/example_001.php
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_001.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 001 for TCPDF class
|
||||||
|
// Default Header and Footer
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Default Header and Footer
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 001');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
|
||||||
|
$pdf->setFooterData(array(0,64,0), array(0,64,128));
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set default font subsetting mode
|
||||||
|
$pdf->setFontSubsetting(true);
|
||||||
|
|
||||||
|
// Set font
|
||||||
|
// dejavusans is a UTF-8 Unicode font, if you only need to
|
||||||
|
// print standard ASCII chars, you can use core fonts like
|
||||||
|
// helvetica or times to reduce file size.
|
||||||
|
$pdf->SetFont('dejavusans', '', 14, '', true);
|
||||||
|
|
||||||
|
// Add a page
|
||||||
|
// This method has several options, check the source code documentation for more information.
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set text shadow effect
|
||||||
|
$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
|
||||||
|
|
||||||
|
// Set some content to print
|
||||||
|
$html = <<<EOD
|
||||||
|
<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;"> <span style="color:black;">TC</span><span style="color:white;">PDF</span> </a>!</h1>
|
||||||
|
<i>This is the first example of TCPDF library.</i>
|
||||||
|
<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
|
||||||
|
<p>Please check the source code documentation and other examples for further information.</p>
|
||||||
|
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// Print text using writeHTMLCell()
|
||||||
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// Close and output PDF document
|
||||||
|
// This method has several options, check the source code documentation for more information.
|
||||||
|
$pdf->Output('example_001.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
87
TCPDF/examples/example_002.php
Normal file
87
TCPDF/examples/example_002.php
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_002.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 002 for TCPDF class
|
||||||
|
// Removing Header and Footer
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Removing Header and Footer
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 002');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// remove default header/footer
|
||||||
|
$pdf->setPrintHeader(false);
|
||||||
|
$pdf->setPrintFooter(false);
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'BI', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set some text to print
|
||||||
|
$txt = <<<EOD
|
||||||
|
TCPDF Example 002
|
||||||
|
|
||||||
|
Default page header and footer are disabled using setPrintHeader() and setPrintFooter() methods.
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// print a block of text using Write()
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_002.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
118
TCPDF/examples/example_003.php
Normal file
118
TCPDF/examples/example_003.php
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_003.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 003 for TCPDF class
|
||||||
|
// Custom Header and Footer
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Custom Header and Footer
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
|
||||||
|
// Extend the TCPDF class to create custom Header and Footer
|
||||||
|
class MYPDF extends TCPDF {
|
||||||
|
|
||||||
|
//Page header
|
||||||
|
public function Header() {
|
||||||
|
// Logo
|
||||||
|
$image_file = K_PATH_IMAGES.'logo_example.jpg';
|
||||||
|
$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
|
||||||
|
// Set font
|
||||||
|
$this->SetFont('helvetica', 'B', 20);
|
||||||
|
// Title
|
||||||
|
$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Page footer
|
||||||
|
public function Footer() {
|
||||||
|
// Position at 15 mm from bottom
|
||||||
|
$this->SetY(-15);
|
||||||
|
// Set font
|
||||||
|
$this->SetFont('helvetica', 'I', 8);
|
||||||
|
// Page number
|
||||||
|
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 003');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'BI', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set some text to print
|
||||||
|
$txt = <<<EOD
|
||||||
|
TCPDF Example 003
|
||||||
|
|
||||||
|
Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// print a block of text using Write()
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_003.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
121
TCPDF/examples/example_004.php
Normal file
121
TCPDF/examples/example_004.php
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_004.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 004 for TCPDF class
|
||||||
|
// Cell stretching
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Cell stretching
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 004');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 004', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 11);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
//Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
|
||||||
|
|
||||||
|
// test Cell stretching
|
||||||
|
$pdf->Cell(0, 0, 'TEST CELL STRETCH: no stretch', 1, 1, 'C', 0, '', 0);
|
||||||
|
$pdf->Cell(0, 0, 'TEST CELL STRETCH: scaling', 1, 1, 'C', 0, '', 1);
|
||||||
|
$pdf->Cell(0, 0, 'TEST CELL STRETCH: force scaling', 1, 1, 'C', 0, '', 2);
|
||||||
|
$pdf->Cell(0, 0, 'TEST CELL STRETCH: spacing', 1, 1, 'C', 0, '', 3);
|
||||||
|
$pdf->Cell(0, 0, 'TEST CELL STRETCH: force spacing', 1, 1, 'C', 0, '', 4);
|
||||||
|
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$pdf->Cell(45, 0, 'TEST CELL STRETCH: scaling', 1, 1, 'C', 0, '', 1);
|
||||||
|
$pdf->Cell(45, 0, 'TEST CELL STRETCH: force scaling', 1, 1, 'C', 0, '', 2);
|
||||||
|
$pdf->Cell(45, 0, 'TEST CELL STRETCH: spacing', 1, 1, 'C', 0, '', 3);
|
||||||
|
$pdf->Cell(45, 0, 'TEST CELL STRETCH: force spacing', 1, 1, 'C', 0, '', 4);
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// example using general stretching and spacing
|
||||||
|
|
||||||
|
for ($stretching = 90; $stretching <= 110; $stretching += 10) {
|
||||||
|
for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
|
||||||
|
|
||||||
|
// set general stretching (scaling) value
|
||||||
|
$pdf->setFontStretching($stretching);
|
||||||
|
|
||||||
|
// set general spacing value
|
||||||
|
$pdf->setFontSpacing($spacing);
|
||||||
|
|
||||||
|
$pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, no stretch', 1, 1, 'C', 0, '', 0);
|
||||||
|
$pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, scaling', 1, 1, 'C', 0, '', 1);
|
||||||
|
$pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, force scaling', 1, 1, 'C', 0, '', 2);
|
||||||
|
$pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, spacing', 1, 1, 'C', 0, '', 3);
|
||||||
|
$pdf->Cell(0, 0, 'Stretching '.$stretching.'%, Spacing '.sprintf('%+.3F', $spacing).'mm, force spacing', 1, 1, 'C', 0, '', 4);
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_004.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
158
TCPDF/examples/example_005.php
Normal file
158
TCPDF/examples/example_005.php
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_005.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 005 for TCPDF class
|
||||||
|
// Multicell
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Multicell
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 005');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 005', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 10);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set cell padding
|
||||||
|
$pdf->setCellPaddings(1, 1, 1, 1);
|
||||||
|
|
||||||
|
// set cell margins
|
||||||
|
$pdf->setCellMargins(1, 1, 1, 1);
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(255, 255, 127);
|
||||||
|
|
||||||
|
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
|
||||||
|
|
||||||
|
// set some text for example
|
||||||
|
$txt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
|
||||||
|
|
||||||
|
// Multicell test
|
||||||
|
$pdf->MultiCell(55, 5, '[LEFT] '.$txt, 1, 'L', 1, 0, '', '', true);
|
||||||
|
$pdf->MultiCell(55, 5, '[RIGHT] '.$txt, 1, 'R', 0, 1, '', '', true);
|
||||||
|
$pdf->MultiCell(55, 5, '[CENTER] '.$txt, 1, 'C', 0, 0, '', '', true);
|
||||||
|
$pdf->MultiCell(55, 5, '[JUSTIFY] '.$txt."\n", 1, 'J', 1, 2, '' ,'', true);
|
||||||
|
$pdf->MultiCell(55, 5, '[DEFAULT] '.$txt, 1, '', 0, 1, '', '', true);
|
||||||
|
|
||||||
|
$pdf->Ln(4);
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(220, 255, 220);
|
||||||
|
|
||||||
|
// Vertical alignment
|
||||||
|
$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - TOP] '.$txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'T');
|
||||||
|
$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - MIDDLE] '.$txt, 1, 'J', 1, 0, '', '', true, 0, false, true, 40, 'M');
|
||||||
|
$pdf->MultiCell(55, 40, '[VERTICAL ALIGNMENT - BOTTOM] '.$txt, 1, 'J', 1, 1, '', '', true, 0, false, true, 40, 'B');
|
||||||
|
|
||||||
|
$pdf->Ln(4);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(215, 235, 255);
|
||||||
|
|
||||||
|
// set some text for example
|
||||||
|
$txt = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
|
||||||
|
|
||||||
|
Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.';
|
||||||
|
|
||||||
|
// print a blox of text using multicell()
|
||||||
|
$pdf->MultiCell(80, 5, $txt."\n", 1, 'J', 1, 1, '' ,'', true);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// AUTO-FITTING
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(255, 235, 235);
|
||||||
|
|
||||||
|
// Fit text on cell by reducing font size
|
||||||
|
$pdf->MultiCell(55, 60, '[FIT CELL] '.$txt."\n", 1, 'J', 1, 1, 125, 145, true, 0, false, true, 60, 'M', true);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// CUSTOM PADDING
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(255, 255, 215);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 8);
|
||||||
|
|
||||||
|
// set cell padding
|
||||||
|
$pdf->setCellPaddings(2, 4, 6, 8);
|
||||||
|
|
||||||
|
$txt = "CUSTOM PADDING:\nLeft=2, Top=4, Right=6, Bottom=8\nLorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue.\n";
|
||||||
|
|
||||||
|
$pdf->MultiCell(55, 5, $txt, 1, 'J', 1, 2, 125, 210, true);
|
||||||
|
|
||||||
|
// move pointer to last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_005.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
330
TCPDF/examples/example_006.php
Normal file
330
TCPDF/examples/example_006.php
Normal file
|
@ -0,0 +1,330 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_006.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 006 for TCPDF class
|
||||||
|
// WriteHTML and RTL support
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: WriteHTML and RTL support
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 006');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('dejavusans', '', 10);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='')
|
||||||
|
// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true)
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$html = '<h1>HTML Example</h1>
|
||||||
|
Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash
|
||||||
|
<h2>List</h2>
|
||||||
|
List example:
|
||||||
|
<ol>
|
||||||
|
<li><img src="images/logo_example.png" alt="test alt attribute" width="30" height="30" border="0" /> test image</li>
|
||||||
|
<li><b>bold text</b></li>
|
||||||
|
<li><i>italic text</i></li>
|
||||||
|
<li><u>underlined text</u></li>
|
||||||
|
<li><b>b<i>bi<u>biu</u>bi</i>b</b></li>
|
||||||
|
<li><a href="http://www.tecnick.com" dir="ltr">link to http://www.tecnick.com</a></li>
|
||||||
|
<li>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.<br />Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</li>
|
||||||
|
<li>SUBLIST
|
||||||
|
<ol>
|
||||||
|
<li>row one
|
||||||
|
<ul>
|
||||||
|
<li>sublist</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>row two</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
<li><b>T</b>E<i>S</i><u>T</u> <del>line through</del></li>
|
||||||
|
<li><font size="+3">font + 3</font></li>
|
||||||
|
<li><small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal</li>
|
||||||
|
</ol>
|
||||||
|
<dl>
|
||||||
|
<dt>Coffee</dt>
|
||||||
|
<dd>Black hot drink</dd>
|
||||||
|
<dt>Milk</dt>
|
||||||
|
<dd>White cold drink</dd>
|
||||||
|
</dl>
|
||||||
|
<div style="text-align:center">IMAGES<br />
|
||||||
|
<img src="images/logo_example.png" alt="test alt attribute" width="100" height="100" border="0" /><img src="images/tcpdf_box.svg" alt="test alt attribute" width="100" height="100" border="0" /><img src="images/logo_example.jpg" alt="test alt attribute" width="100" height="100" border="0" />
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
|
||||||
|
// output some RTL HTML content
|
||||||
|
$html = '<div style="text-align:center">The words “<span dir="rtl">מזל [mazel] טוב [tov]</span>” mean “Congratulations!”</div>';
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// test some inline CSS
|
||||||
|
$html = '<p>This is just an example of html code to demonstrate some supported CSS inline styles.
|
||||||
|
<span style="font-weight: bold;">bold text</span>
|
||||||
|
<span style="text-decoration: line-through;">line-trough</span>
|
||||||
|
<span style="text-decoration: underline line-through;">underline and line-trough</span>
|
||||||
|
<span style="color: rgb(0, 128, 64);">color</span>
|
||||||
|
<span style="background-color: rgb(255, 0, 0); color: rgb(255, 255, 255);">background color</span>
|
||||||
|
<span style="font-weight: bold;">bold</span>
|
||||||
|
<span style="font-size: xx-small;">xx-small</span>
|
||||||
|
<span style="font-size: x-small;">x-small</span>
|
||||||
|
<span style="font-size: small;">small</span>
|
||||||
|
<span style="font-size: medium;">medium</span>
|
||||||
|
<span style="font-size: large;">large</span>
|
||||||
|
<span style="font-size: x-large;">x-large</span>
|
||||||
|
<span style="font-size: xx-large;">xx-large</span>
|
||||||
|
</p>';
|
||||||
|
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Print a table
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$subtable = '<table border="1" cellspacing="6" cellpadding="4"><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>';
|
||||||
|
|
||||||
|
$html = '<h2>HTML TABLE:</h2>
|
||||||
|
<table border="1" cellspacing="3" cellpadding="4">
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th align="right">RIGHT align</th>
|
||||||
|
<th align="left">LEFT align</th>
|
||||||
|
<th>4A</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1</td>
|
||||||
|
<td bgcolor="#cccccc" align="center" colspan="2">A1 ex<i>amp</i>le <a href="http://www.tcpdf.org">link</a> column span. One two tree four five six seven eight nine ten.<br />line after br<br /><small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<ol><li>first<ol><li>sublist</li><li>sublist</li></ol></li><li>second</li></ol><small color="#FF0000" bgcolor="#FFFF00">small small small small small small small small small small small small small small small small small small small small</small></td>
|
||||||
|
<td>4B</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>'.$subtable.'</td>
|
||||||
|
<td bgcolor="#0000FF" color="yellow" align="center">A2 € € € & è è<br/>A2 € € € & è è</td>
|
||||||
|
<td bgcolor="#FFFF00" align="left"><font color="#FF0000">Red</font> Yellow BG</td>
|
||||||
|
<td>4C</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1A</td>
|
||||||
|
<td rowspan="2" colspan="2" bgcolor="#FFFFCC">2AA<br />2AB<br />2AC</td>
|
||||||
|
<td bgcolor="#FF0000">4D</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1B</td>
|
||||||
|
<td>4E</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1C</td>
|
||||||
|
<td>2C</td>
|
||||||
|
<td>3C</td>
|
||||||
|
<td>4F</td>
|
||||||
|
</tr>
|
||||||
|
</table>';
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// Print some HTML Cells
|
||||||
|
|
||||||
|
$html = '<span color="red">red</span> <span color="green">green</span> <span color="blue">blue</span><br /><span color="red">red</span> <span color="green">green</span> <span color="blue">blue</span>';
|
||||||
|
|
||||||
|
$pdf->SetFillColor(255,255,0);
|
||||||
|
|
||||||
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'L', true);
|
||||||
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 1, true, 'C', true);
|
||||||
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'R', true);
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Print a table
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$html = '<h1>Image alignments on HTML table</h1>
|
||||||
|
<table cellpadding="1" cellspacing="1" border="1" style="text-align:center;">
|
||||||
|
<tr><td><img src="images/logo_example.png" border="0" height="41" width="41" /></td></tr>
|
||||||
|
<tr style="text-align:left;"><td><img src="images/logo_example.png" border="0" height="41" width="41" align="top" /></td></tr>
|
||||||
|
<tr style="text-align:center;"><td><img src="images/logo_example.png" border="0" height="41" width="41" align="middle" /></td></tr>
|
||||||
|
<tr style="text-align:right;"><td><img src="images/logo_example.png" border="0" height="41" width="41" align="bottom" /></td></tr>
|
||||||
|
<tr><td style="text-align:left;"><img src="images/logo_example.png" border="0" height="41" width="41" align="top" /></td></tr>
|
||||||
|
<tr><td style="text-align:center;"><img src="images/logo_example.png" border="0" height="41" width="41" align="middle" /></td></tr>
|
||||||
|
<tr><td style="text-align:right;"><img src="images/logo_example.png" border="0" height="41" width="41" align="bottom" /></td></tr>
|
||||||
|
</table>';
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// Print all HTML colors
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$textcolors = '<h1>HTML Text Colors</h1>';
|
||||||
|
$bgcolors = '<hr /><h1>HTML Background Colors</h1>';
|
||||||
|
|
||||||
|
foreach(TCPDF_COLORS::$webcolor as $k => $v) {
|
||||||
|
$textcolors .= '<span color="#'.$v.'">'.$v.'</span> ';
|
||||||
|
$bgcolors .= '<span bgcolor="#'.$v.'" color="#333333">'.$v.'</span> ';
|
||||||
|
}
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($textcolors, true, false, true, false, '');
|
||||||
|
$pdf->writeHTML($bgcolors, true, false, true, false, '');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Test word-wrap
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$html = '<hr />
|
||||||
|
<h1>Various tests</h1>
|
||||||
|
<a href="#2">link to page 2</a><br />
|
||||||
|
<font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font>';
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// Test fonts nesting
|
||||||
|
$html1 = 'Default <font face="courier">Courier <font face="helvetica">Helvetica <font face="times">Times <font face="dejavusans">dejavusans </font>Times </font>Helvetica </font>Courier </font>Default';
|
||||||
|
$html2 = '<small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal';
|
||||||
|
$html3 = '<font size="10" color="#ff7f50">The</font> <font size="10" color="#6495ed">quick</font> <font size="14" color="#dc143c">brown</font> <font size="18" color="#008000">fox</font> <font size="22"><a href="http://www.tcpdf.org">jumps</a></font> <font size="22" color="#a0522d">over</font> <font size="18" color="#da70d6">the</font> <font size="14" color="#9400d3">lazy</font> <font size="10" color="#4169el">dog</font>.';
|
||||||
|
|
||||||
|
$html = $html1.'<br />'.$html2.'<br />'.$html3.'<br />'.$html3.'<br />'.$html2;
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// test pre tag
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$html = <<<EOF
|
||||||
|
<div style="background-color:#880000;color:white;">
|
||||||
|
Hello World!<br />
|
||||||
|
Hello
|
||||||
|
</div>
|
||||||
|
<pre style="background-color:#336699;color:white;">
|
||||||
|
int main() {
|
||||||
|
printf("HelloWorld");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<tt>Monospace font</tt>, normal font, <tt>monospace font</tt>, normal font.
|
||||||
|
<br />
|
||||||
|
<div style="background-color:#880000;color:white;">DIV LEVEL 1<div style="background-color:#008800;color:white;">DIV LEVEL 2</div>DIV LEVEL 1</div>
|
||||||
|
<br />
|
||||||
|
<span style="background-color:#880000;color:white;">SPAN LEVEL 1 <span style="background-color:#008800;color:white;">SPAN LEVEL 2</span> SPAN LEVEL 1</span>
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// test custom bullet points for list
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$html = <<<EOF
|
||||||
|
<h1>Test custom bullet image for list items</h1>
|
||||||
|
<ul style="font-size:14pt;list-style-type:img|png|4|4|images/logo_example.png">
|
||||||
|
<li>test custom bullet image</li>
|
||||||
|
<li>test custom bullet image</li>
|
||||||
|
<li>test custom bullet image</li>
|
||||||
|
<li>test custom bullet image</li>
|
||||||
|
<ul>
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_006.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
113
TCPDF/examples/example_007.php
Normal file
113
TCPDF/examples/example_007.php
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_007.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 007 for TCPDF class
|
||||||
|
// Two independent columns with WriteHTMLCell()
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Two independent columns with WriteHTMLCell()
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 007');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 007', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// create columns content
|
||||||
|
$left_column = '<b>LEFT COLUMN</b> left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column';
|
||||||
|
|
||||||
|
$right_column = '<b>RIGHT COLUMN</b> right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column';
|
||||||
|
|
||||||
|
// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true)
|
||||||
|
|
||||||
|
// get current vertical position
|
||||||
|
$y = $pdf->getY();
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(255, 255, 200);
|
||||||
|
|
||||||
|
// set color for text
|
||||||
|
$pdf->SetTextColor(0, 63, 127);
|
||||||
|
|
||||||
|
// write the first column
|
||||||
|
$pdf->writeHTMLCell(80, '', '', $y, $left_column, 1, 0, 1, true, 'J', true);
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(215, 235, 255);
|
||||||
|
|
||||||
|
// set color for text
|
||||||
|
$pdf->SetTextColor(127, 31, 0);
|
||||||
|
|
||||||
|
// write the second column
|
||||||
|
$pdf->writeHTMLCell(80, '', '', '', $right_column, 1, 1, 1, true, 'J', true);
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_007.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
97
TCPDF/examples/example_008.php
Normal file
97
TCPDF/examples/example_008.php
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_008.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 008 for TCPDF class
|
||||||
|
// Include external UTF-8 text file
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Include external UTF-8 text file
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 008');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 008', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set default font subsetting mode
|
||||||
|
$pdf->setFontSubsetting(true);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('freeserif', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// get esternal file content
|
||||||
|
$utf8text = file_get_contents('data/utf8test.txt', false);
|
||||||
|
|
||||||
|
// set color for text
|
||||||
|
$pdf->SetTextColor(0, 63, 127);
|
||||||
|
|
||||||
|
//Write($h, $txt, $link='', $fill=0, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0)
|
||||||
|
|
||||||
|
// write the text
|
||||||
|
$pdf->Write(5, $utf8text, '', 0, '', false, 0, false, false, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_008.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
146
TCPDF/examples/example_009.php
Normal file
146
TCPDF/examples/example_009.php
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_009.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 009 for TCPDF class
|
||||||
|
// Test Image
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Test Image
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 009');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 009', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set JPEG quality
|
||||||
|
$pdf->setJPEGQuality(75);
|
||||||
|
|
||||||
|
// Image method signature:
|
||||||
|
// Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false)
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Example of Image from data stream ('PHP rules')
|
||||||
|
$imgdata = base64_decode('iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABlBMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDrEX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==');
|
||||||
|
|
||||||
|
// The '@' character is used to indicate that follows an image data stream and not an image file name
|
||||||
|
$pdf->Image('@'.$imgdata);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Image example with resizing
|
||||||
|
$pdf->Image('images/image_demo.jpg', 15, 140, 75, 113, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// test fitbox with all alignment combinations
|
||||||
|
|
||||||
|
$horizontal_alignments = array('L', 'C', 'R');
|
||||||
|
$vertical_alignments = array('T', 'M', 'B');
|
||||||
|
|
||||||
|
$x = 15;
|
||||||
|
$y = 35;
|
||||||
|
$w = 30;
|
||||||
|
$h = 30;
|
||||||
|
// test all combinations of alignments
|
||||||
|
for ($i = 0; $i < 3; ++$i) {
|
||||||
|
$fitbox = $horizontal_alignments[$i].' ';
|
||||||
|
$x = 15;
|
||||||
|
for ($j = 0; $j < 3; ++$j) {
|
||||||
|
$fitbox[1] = $vertical_alignments[$j];
|
||||||
|
$pdf->Rect($x, $y, $w, $h, 'F', array(), array(128,255,128));
|
||||||
|
$pdf->Image('images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
|
||||||
|
$x += 32; // new column
|
||||||
|
}
|
||||||
|
$y += 32; // new row
|
||||||
|
}
|
||||||
|
|
||||||
|
$x = 115;
|
||||||
|
$y = 35;
|
||||||
|
$w = 25;
|
||||||
|
$h = 50;
|
||||||
|
for ($i = 0; $i < 3; ++$i) {
|
||||||
|
$fitbox = $horizontal_alignments[$i].' ';
|
||||||
|
$x = 115;
|
||||||
|
for ($j = 0; $j < 3; ++$j) {
|
||||||
|
$fitbox[1] = $vertical_alignments[$j];
|
||||||
|
$pdf->Rect($x, $y, $w, $h, 'F', array(), array(128,255,255));
|
||||||
|
$pdf->Image('images/image_demo.jpg', $x, $y, $w, $h, 'JPG', '', '', false, 300, '', false, false, 0, $fitbox, false, false);
|
||||||
|
$x += 27; // new column
|
||||||
|
}
|
||||||
|
$y += 52; // new row
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Stretching, position and alignment example
|
||||||
|
|
||||||
|
$pdf->SetXY(110, 200);
|
||||||
|
$pdf->Image('images/image_demo.jpg', '', '', 40, 40, '', '', 'T', false, 300, '', false, false, 1, false, false, false);
|
||||||
|
$pdf->Image('images/image_demo.jpg', '', '', 40, 40, '', '', '', false, 300, '', false, false, 1, false, false, false);
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_009.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
150
TCPDF/examples/example_010.php
Normal file
150
TCPDF/examples/example_010.php
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_010.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 010 for TCPDF class
|
||||||
|
// Text on multiple columns
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Text on multiple columns
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend TCPDF to work with multiple columns
|
||||||
|
*/
|
||||||
|
class MC_TCPDF extends TCPDF {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print chapter
|
||||||
|
* @param $num (int) chapter number
|
||||||
|
* @param $title (string) chapter title
|
||||||
|
* @param $file (string) name of the file containing the chapter body
|
||||||
|
* @param $mode (boolean) if true the chapter body is in HTML, otherwise in simple text.
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
public function PrintChapter($num, $title, $file, $mode=false) {
|
||||||
|
// add a new page
|
||||||
|
$this->AddPage();
|
||||||
|
// disable existing columns
|
||||||
|
$this->resetColumns();
|
||||||
|
// print chapter title
|
||||||
|
$this->ChapterTitle($num, $title);
|
||||||
|
// set columns
|
||||||
|
$this->setEqualColumns(3, 57);
|
||||||
|
// print chapter body
|
||||||
|
$this->ChapterBody($file, $mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set chapter title
|
||||||
|
* @param $num (int) chapter number
|
||||||
|
* @param $title (string) chapter title
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
public function ChapterTitle($num, $title) {
|
||||||
|
$this->SetFont('helvetica', '', 14);
|
||||||
|
$this->SetFillColor(200, 220, 255);
|
||||||
|
$this->Cell(180, 6, 'Chapter '.$num.' : '.$title, 0, 1, '', 1);
|
||||||
|
$this->Ln(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print chapter body
|
||||||
|
* @param $file (string) name of the file containing the chapter body
|
||||||
|
* @param $mode (boolean) if true the chapter body is in HTML, otherwise in simple text.
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
public function ChapterBody($file, $mode=false) {
|
||||||
|
$this->selectColumn();
|
||||||
|
// get esternal file content
|
||||||
|
$content = file_get_contents($file, false);
|
||||||
|
// set font
|
||||||
|
$this->SetFont('times', '', 9);
|
||||||
|
$this->SetTextColor(50, 50, 50);
|
||||||
|
// print content
|
||||||
|
if ($mode) {
|
||||||
|
// ------ HTML MODE ------
|
||||||
|
$this->writeHTML($content, true, false, true, false, 'J');
|
||||||
|
} else {
|
||||||
|
// ------ TEXT MODE ------
|
||||||
|
$this->Write(0, $content, '', 0, 'J', true, 0, false, true, 0);
|
||||||
|
}
|
||||||
|
$this->Ln();
|
||||||
|
}
|
||||||
|
} // end of extended class
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// EXAMPLE
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new MC_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 010');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 010', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// print TEXT
|
||||||
|
$pdf->PrintChapter(1, 'LOREM IPSUM [TEXT]', 'data/chapter_demo_1.txt', false);
|
||||||
|
|
||||||
|
// print HTML
|
||||||
|
$pdf->PrintChapter(2, 'LOREM IPSUM [HTML]', 'data/chapter_demo_2.txt', true);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_010.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
138
TCPDF/examples/example_011.php
Normal file
138
TCPDF/examples/example_011.php
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_011.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 011 for TCPDF class
|
||||||
|
// Colored Table (very simple table)
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Colored Table
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// extend TCPF with custom functions
|
||||||
|
class MYPDF extends TCPDF {
|
||||||
|
|
||||||
|
// Load table data from file
|
||||||
|
public function LoadData($file) {
|
||||||
|
// Read file lines
|
||||||
|
$lines = file($file);
|
||||||
|
$data = array();
|
||||||
|
foreach($lines as $line) {
|
||||||
|
$data[] = explode(';', chop($line));
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Colored table
|
||||||
|
public function ColoredTable($header,$data) {
|
||||||
|
// Colors, line width and bold font
|
||||||
|
$this->SetFillColor(255, 0, 0);
|
||||||
|
$this->SetTextColor(255);
|
||||||
|
$this->SetDrawColor(128, 0, 0);
|
||||||
|
$this->SetLineWidth(0.3);
|
||||||
|
$this->SetFont('', 'B');
|
||||||
|
// Header
|
||||||
|
$w = array(40, 35, 40, 45);
|
||||||
|
$num_headers = count($header);
|
||||||
|
for($i = 0; $i < $num_headers; ++$i) {
|
||||||
|
$this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1);
|
||||||
|
}
|
||||||
|
$this->Ln();
|
||||||
|
// Color and font restoration
|
||||||
|
$this->SetFillColor(224, 235, 255);
|
||||||
|
$this->SetTextColor(0);
|
||||||
|
$this->SetFont('');
|
||||||
|
// Data
|
||||||
|
$fill = 0;
|
||||||
|
foreach($data as $row) {
|
||||||
|
$this->Cell($w[0], 6, $row[0], 'LR', 0, 'L', $fill);
|
||||||
|
$this->Cell($w[1], 6, $row[1], 'LR', 0, 'L', $fill);
|
||||||
|
$this->Cell($w[2], 6, number_format($row[2]), 'LR', 0, 'R', $fill);
|
||||||
|
$this->Cell($w[3], 6, number_format($row[3]), 'LR', 0, 'R', $fill);
|
||||||
|
$this->Ln();
|
||||||
|
$fill=!$fill;
|
||||||
|
}
|
||||||
|
$this->Cell(array_sum($w), 0, '', 'T');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 011');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 011', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// column titles
|
||||||
|
$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
|
||||||
|
|
||||||
|
// data loading
|
||||||
|
$data = $pdf->LoadData('data/table_data_demo.txt');
|
||||||
|
|
||||||
|
// print colored table
|
||||||
|
$pdf->ColoredTable($header, $data);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// close and output PDF document
|
||||||
|
$pdf->Output('example_011.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
BIN
TCPDF/examples/example_012.pdf
Normal file
BIN
TCPDF/examples/example_012.pdf
Normal file
Binary file not shown.
205
TCPDF/examples/example_012.php
Normal file
205
TCPDF/examples/example_012.php
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_012.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 012 for TCPDF class
|
||||||
|
// Graphic Functions
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Graphic Functions
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 012');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// disable header and footer
|
||||||
|
$pdf->setPrintHeader(false);
|
||||||
|
$pdf->setPrintFooter(false);
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
|
||||||
|
$style2 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));
|
||||||
|
$style3 = array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 0, 0));
|
||||||
|
$style4 = array('L' => 0,
|
||||||
|
'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)),
|
||||||
|
'R' => array('width' => 0.50, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)),
|
||||||
|
'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
|
||||||
|
$style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
|
||||||
|
$style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
|
||||||
|
$style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
|
||||||
|
|
||||||
|
// Line
|
||||||
|
$pdf->Text(5, 4, 'Line examples');
|
||||||
|
$pdf->Line(5, 10, 80, 30, $style);
|
||||||
|
$pdf->Line(5, 10, 5, 30, $style2);
|
||||||
|
$pdf->Line(5, 10, 80, 10, $style3);
|
||||||
|
|
||||||
|
// Rect
|
||||||
|
$pdf->Text(100, 4, 'Rectangle examples');
|
||||||
|
$pdf->Rect(100, 10, 40, 20, 'DF', $style4, array(220, 220, 200));
|
||||||
|
$pdf->Rect(145, 10, 40, 20, 'D', array('all' => $style3));
|
||||||
|
|
||||||
|
// Curve
|
||||||
|
$pdf->Text(5, 34, 'Curve examples');
|
||||||
|
$pdf->Curve(5, 40, 30, 55, 70, 45, 60, 75, null, $style6);
|
||||||
|
$pdf->Curve(80, 40, 70, 75, 150, 45, 100, 75, 'F', $style6);
|
||||||
|
$pdf->Curve(140, 40, 150, 55, 180, 45, 200, 75, 'DF', $style6, array(200, 220, 200));
|
||||||
|
|
||||||
|
// Circle and ellipse
|
||||||
|
$pdf->Text(5, 79, 'Circle and ellipse examples');
|
||||||
|
$pdf->SetLineStyle($style5);
|
||||||
|
$pdf->Circle(25,105,20);
|
||||||
|
$pdf->Circle(25,105,10, 90, 180, null, $style6);
|
||||||
|
$pdf->Circle(25,105,10, 270, 360, 'F');
|
||||||
|
$pdf->Circle(25,105,10, 270, 360, 'C', $style6);
|
||||||
|
|
||||||
|
$pdf->SetLineStyle($style5);
|
||||||
|
$pdf->Ellipse(100,103,40,20);
|
||||||
|
$pdf->Ellipse(100,105,20,10, 0, 90, 180, null, $style6);
|
||||||
|
$pdf->Ellipse(100,105,20,10, 0, 270, 360, 'DF', $style6);
|
||||||
|
|
||||||
|
$pdf->SetLineStyle($style5);
|
||||||
|
$pdf->Ellipse(175,103,30,15,45);
|
||||||
|
$pdf->Ellipse(175,105,15,7.50, 45, 90, 180, null, $style6);
|
||||||
|
$pdf->Ellipse(175,105,15,7.50, 45, 270, 360, 'F', $style6, array(220, 200, 200));
|
||||||
|
|
||||||
|
// Polygon
|
||||||
|
$pdf->Text(5, 129, 'Polygon examples');
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||||
|
$pdf->Polygon(array(5,135,45,135,15,165));
|
||||||
|
$pdf->Polygon(array(60,135,80,135,80,155,70,165,50,155), 'DF', array($style6, $style7, $style7, 0, $style6), array(220, 200, 200));
|
||||||
|
$pdf->Polygon(array(120,135,140,135,150,155,110,155), 'D', array($style6, 0, $style7, $style6));
|
||||||
|
$pdf->Polygon(array(160,135,190,155,170,155,200,160,160,165), 'DF', array('all' => $style6), array(220, 220, 220));
|
||||||
|
|
||||||
|
// Polygonal Line
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 164)));
|
||||||
|
$pdf->PolyLine(array(80,165,90,160,100,165,110,160,120,165,130,160,140,165), 'D', array(), array());
|
||||||
|
|
||||||
|
// Regular polygon
|
||||||
|
$pdf->Text(5, 169, 'Regular polygon examples');
|
||||||
|
$pdf->SetLineStyle($style5);
|
||||||
|
$pdf->RegularPolygon(20, 190, 15, 6, 0, 1, 'F');
|
||||||
|
$pdf->RegularPolygon(55, 190, 15, 6);
|
||||||
|
$pdf->RegularPolygon(55, 190, 10, 6, 45, 0, 'DF', array($style6, 0, $style7, 0, $style7, $style7));
|
||||||
|
$pdf->RegularPolygon(90, 190, 15, 3, 0, 1, 'DF', array('all' => $style5), array(200, 220, 200), 'F', array(255, 200, 200));
|
||||||
|
$pdf->RegularPolygon(125, 190, 15, 4, 30, 1, null, array('all' => $style5), null, null, $style6);
|
||||||
|
$pdf->RegularPolygon(160, 190, 15, 10);
|
||||||
|
|
||||||
|
// Star polygon
|
||||||
|
$pdf->Text(5, 209, 'Star polygon examples');
|
||||||
|
$pdf->SetLineStyle($style5);
|
||||||
|
$pdf->StarPolygon(20, 230, 15, 20, 3, 0, 1, 'F');
|
||||||
|
$pdf->StarPolygon(55, 230, 15, 12, 5);
|
||||||
|
$pdf->StarPolygon(55, 230, 7, 12, 5, 45, 0, 'DF', array('all' => $style7), array(220, 220, 200), 'F', array(255, 200, 200));
|
||||||
|
$pdf->StarPolygon(90, 230, 15, 20, 6, 0, 1, 'DF', array('all' => $style5), array(220, 220, 200), 'F', array(255, 200, 200));
|
||||||
|
$pdf->StarPolygon(125, 230, 15, 5, 2, 30, 1, null, array('all' => $style5), null, null, $style6);
|
||||||
|
$pdf->StarPolygon(160, 230, 15, 10, 3);
|
||||||
|
$pdf->StarPolygon(160, 230, 7, 50, 26);
|
||||||
|
|
||||||
|
// Rounded rectangle
|
||||||
|
$pdf->Text(5, 249, 'Rounded rectangle examples');
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||||
|
$pdf->RoundedRect(5, 255, 40, 30, 3.50, '1111', 'DF');
|
||||||
|
$pdf->RoundedRect(50, 255, 40, 30, 6.50, '1000');
|
||||||
|
$pdf->RoundedRect(95, 255, 40, 30, 10.0, '1111', null, $style6);
|
||||||
|
$pdf->RoundedRect(140, 255, 40, 30, 8.0, '0101', 'DF', $style6, array(200, 200, 200));
|
||||||
|
|
||||||
|
// Arrows
|
||||||
|
$pdf->Text(185, 249, 'Arrows');
|
||||||
|
$pdf->SetLineStyle($style5);
|
||||||
|
$pdf->SetFillColor(255, 0, 0);
|
||||||
|
$pdf->Arrow(200, 280, 185, 266, 0, 5, 15);
|
||||||
|
$pdf->Arrow(200, 280, 190, 263, 1, 5, 15);
|
||||||
|
$pdf->Arrow(200, 280, 195, 261, 2, 5, 15);
|
||||||
|
$pdf->Arrow(200, 280, 200, 260, 3, 5, 15);
|
||||||
|
|
||||||
|
// - . - . - . - . - . - . - . - . - . - . - . - . - . - . -
|
||||||
|
|
||||||
|
// ellipse
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Cell(0, 0, 'Arc of Ellipse');
|
||||||
|
|
||||||
|
// center of ellipse
|
||||||
|
$xc=100;
|
||||||
|
$yc=100;
|
||||||
|
|
||||||
|
// X Y axis
|
||||||
|
$pdf->SetDrawColor(200, 200, 200);
|
||||||
|
$pdf->Line($xc-50, $yc, $xc+50, $yc);
|
||||||
|
$pdf->Line($xc, $yc-50, $xc, $yc+50);
|
||||||
|
|
||||||
|
// ellipse axis
|
||||||
|
$pdf->SetDrawColor(200, 220, 255);
|
||||||
|
$pdf->Line($xc-50, $yc-50, $xc+50, $yc+50);
|
||||||
|
$pdf->Line($xc-50, $yc+50, $xc+50, $yc-50);
|
||||||
|
|
||||||
|
// ellipse
|
||||||
|
$pdf->SetDrawColor(200, 255, 200);
|
||||||
|
$pdf->Ellipse($xc, $yc, 30, 15, 45, 0, 360, 'D', array(), array(), 2);
|
||||||
|
|
||||||
|
// ellipse arc
|
||||||
|
$pdf->SetDrawColor(255, 0, 0);
|
||||||
|
$pdf->Ellipse($xc, $yc, 30, 15, 45, 45, 90, 'D', array(), array(), 2);
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_012.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
229
TCPDF/examples/example_013.php
Normal file
229
TCPDF/examples/example_013.php
Normal file
|
@ -0,0 +1,229 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_013.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 013 for TCPDF class
|
||||||
|
// Graphic Transformations
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Graphic Transformations
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 013');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 013', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Graphic Transformations', '', 0, 'C', 1, 0, false, false, 0);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// --- Scaling ---------------------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(50, 70, 40, 10, 'D');
|
||||||
|
$pdf->Text(50, 66, 'Scale');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// Scale by 150% centered by (50,80) which is the lower left corner of the rectangle
|
||||||
|
$pdf->ScaleXY(150, 50, 80);
|
||||||
|
$pdf->Rect(50, 70, 40, 10, 'D');
|
||||||
|
$pdf->Text(50, 66, 'Scale');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Translation -----------------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(125, 70, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 66, 'Translate');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// Translate 7 to the right, 5 to the bottom
|
||||||
|
$pdf->Translate(7, 5);
|
||||||
|
$pdf->Rect(125, 70, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 66, 'Translate');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Rotation --------------------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(70, 100, 40, 10, 'D');
|
||||||
|
$pdf->Text(70, 96, 'Rotate');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// Rotate 20 degrees counter-clockwise centered by (70,110) which is the lower left corner of the rectangle
|
||||||
|
$pdf->Rotate(20, 70, 110);
|
||||||
|
$pdf->Rect(70, 100, 40, 10, 'D');
|
||||||
|
$pdf->Text(70, 96, 'Rotate');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Skewing ---------------------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(125, 100, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 96, 'Skew');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// skew 30 degrees along the x-axis centered by (125,110) which is the lower left corner of the rectangle
|
||||||
|
$pdf->SkewX(30, 125, 110);
|
||||||
|
$pdf->Rect(125, 100, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 96, 'Skew');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Mirroring horizontally ------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(70, 130, 40, 10, 'D');
|
||||||
|
$pdf->Text(70, 126, 'MirrorH');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// mirror horizontally with axis of reflection at x-position 70 (left side of the rectangle)
|
||||||
|
$pdf->MirrorH(70);
|
||||||
|
$pdf->Rect(70, 130, 40, 10, 'D');
|
||||||
|
$pdf->Text(70, 126, 'MirrorH');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Mirroring vertically --------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(125, 130, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 126, 'MirrorV');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// mirror vertically with axis of reflection at y-position 140 (bottom side of the rectangle)
|
||||||
|
$pdf->MirrorV(140);
|
||||||
|
$pdf->Rect(125, 130, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 126, 'MirrorV');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Point reflection ------------------------------------
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(70, 160, 40, 10, 'D');
|
||||||
|
$pdf->Text(70, 156, 'MirrorP');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
// Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
// point reflection at the lower left point of rectangle
|
||||||
|
$pdf->MirrorP(70,170);
|
||||||
|
$pdf->Rect(70, 160, 40, 10, 'D');
|
||||||
|
$pdf->Text(70, 156, 'MirrorP');
|
||||||
|
// Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// --- Mirroring against a straigth line described by a point (120, 120) and an angle -20°
|
||||||
|
$angle=-20;
|
||||||
|
$px=120;
|
||||||
|
$py=170;
|
||||||
|
|
||||||
|
// just for visualisation: the straight line to mirror against
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->Line($px-1,$py-1,$px+1,$py+1);
|
||||||
|
$pdf->Line($px-1,$py+1,$px+1,$py-1);
|
||||||
|
$pdf->StartTransform();
|
||||||
|
$pdf->Rotate($angle, $px, $py);
|
||||||
|
$pdf->Line($px-5, $py, $px+60, $py);
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(200);
|
||||||
|
$pdf->SetTextColor(200);
|
||||||
|
$pdf->Rect(125, 160, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 156, 'MirrorL');
|
||||||
|
$pdf->SetDrawColor(0);
|
||||||
|
$pdf->SetTextColor(0);
|
||||||
|
//Start Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
//mirror against the straight line
|
||||||
|
$pdf->MirrorL($angle, $px, $py);
|
||||||
|
$pdf->Rect(125, 160, 40, 10, 'D');
|
||||||
|
$pdf->Text(125, 156, 'MirrorL');
|
||||||
|
//Stop Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_013.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
194
TCPDF/examples/example_014.php
Normal file
194
TCPDF/examples/example_014.php
Normal file
|
@ -0,0 +1,194 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_014.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 014 for TCPDF class
|
||||||
|
// Javascript Form and user rights (only works on Adobe Acrobat)
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Javascript Form and user rights (only works on Adobe Acrobat)
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 014');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 014', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// IMPORTANT: disable font subsetting to allow users editing the document
|
||||||
|
$pdf->setFontSubsetting(false);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 10, '', false);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
/*
|
||||||
|
It is possible to create text fields, combo boxes, check boxes and buttons.
|
||||||
|
Fields are created at the current position and are given a name.
|
||||||
|
This name allows to manipulate them via JavaScript in order to perform some validation for instance.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// set default form properties
|
||||||
|
$pdf->setFormDefaultProp(array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 200), 'strokeColor'=>array(255, 128, 128)));
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', 'BI', 18);
|
||||||
|
$pdf->Cell(0, 5, 'Example of Form', 0, 1, 'C');
|
||||||
|
$pdf->Ln(10);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 12);
|
||||||
|
|
||||||
|
// First name
|
||||||
|
$pdf->Cell(35, 5, 'First name:');
|
||||||
|
$pdf->TextField('firstname', 50, 5);
|
||||||
|
$pdf->Ln(6);
|
||||||
|
|
||||||
|
// Last name
|
||||||
|
$pdf->Cell(35, 5, 'Last name:');
|
||||||
|
$pdf->TextField('lastname', 50, 5);
|
||||||
|
$pdf->Ln(6);
|
||||||
|
|
||||||
|
// Gender
|
||||||
|
$pdf->Cell(35, 5, 'Gender:');
|
||||||
|
$pdf->ComboBox('gender', 30, 5, array(array('', '-'), array('M', 'Male'), array('F', 'Female')));
|
||||||
|
$pdf->Ln(6);
|
||||||
|
|
||||||
|
// Drink
|
||||||
|
$pdf->Cell(35, 5, 'Drink:');
|
||||||
|
//$pdf->RadioButton('drink', 5, array('readonly' => 'true'), array(), 'Water');
|
||||||
|
$pdf->RadioButton('drink', 5, array(), array(), 'Water');
|
||||||
|
$pdf->Cell(35, 5, 'Water');
|
||||||
|
$pdf->Ln(6);
|
||||||
|
$pdf->Cell(35, 5, '');
|
||||||
|
$pdf->RadioButton('drink', 5, array(), array(), 'Beer', true);
|
||||||
|
$pdf->Cell(35, 5, 'Beer');
|
||||||
|
$pdf->Ln(6);
|
||||||
|
$pdf->Cell(35, 5, '');
|
||||||
|
$pdf->RadioButton('drink', 5, array(), array(), 'Wine');
|
||||||
|
$pdf->Cell(35, 5, 'Wine');
|
||||||
|
$pdf->Ln(6);
|
||||||
|
$pdf->Cell(35, 5, '');
|
||||||
|
$pdf->RadioButton('drink', 5, array(), array(), 'Milk');
|
||||||
|
$pdf->Cell(35, 5, 'Milk');
|
||||||
|
$pdf->Ln(10);
|
||||||
|
|
||||||
|
// Newsletter
|
||||||
|
$pdf->Cell(35, 5, 'Newsletter:');
|
||||||
|
$pdf->CheckBox('newsletter', 5, true, array(), array(), 'OK');
|
||||||
|
|
||||||
|
$pdf->Ln(10);
|
||||||
|
// Address
|
||||||
|
$pdf->Cell(35, 5, 'Address:');
|
||||||
|
$pdf->TextField('address', 60, 18, array('multiline'=>true, 'lineWidth'=>0, 'borderStyle'=>'none'), array('v'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'dv'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'));
|
||||||
|
$pdf->Ln(19);
|
||||||
|
|
||||||
|
// Listbox
|
||||||
|
$pdf->Cell(35, 5, 'List:');
|
||||||
|
$pdf->ListBox('listbox', 60, 15, array('', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7'), array('multipleSelection'=>'true'));
|
||||||
|
$pdf->Ln(20);
|
||||||
|
|
||||||
|
// E-mail
|
||||||
|
$pdf->Cell(35, 5, 'E-mail:');
|
||||||
|
$pdf->TextField('email', 50, 5);
|
||||||
|
$pdf->Ln(6);
|
||||||
|
|
||||||
|
// Date of the day
|
||||||
|
$pdf->Cell(35, 5, 'Date:');
|
||||||
|
$pdf->TextField('date', 30, 5, array(), array('v'=>date('Y-m-d'), 'dv'=>date('Y-m-d')));
|
||||||
|
$pdf->Ln(10);
|
||||||
|
|
||||||
|
$pdf->SetX(50);
|
||||||
|
|
||||||
|
// Button to validate and print
|
||||||
|
$pdf->Button('print', 30, 10, 'Print', 'Print()', array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));
|
||||||
|
|
||||||
|
// Reset Button
|
||||||
|
$pdf->Button('reset', 30, 10, 'Reset', array('S'=>'ResetForm'), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));
|
||||||
|
|
||||||
|
// Submit Button
|
||||||
|
$pdf->Button('submit', 30, 10, 'Submit', array('S'=>'SubmitForm', 'F'=>'http://localhost/printvars.php', 'Flags'=>array('ExportFormat')), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));
|
||||||
|
|
||||||
|
// Form validation functions
|
||||||
|
$js = <<<EOD
|
||||||
|
function CheckField(name,message) {
|
||||||
|
var f = getField(name);
|
||||||
|
if(f.value == '') {
|
||||||
|
app.alert(message);
|
||||||
|
f.setFocus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function Print() {
|
||||||
|
if(!CheckField('firstname','First name is mandatory')) {return;}
|
||||||
|
if(!CheckField('lastname','Last name is mandatory')) {return;}
|
||||||
|
if(!CheckField('gender','Gender is mandatory')) {return;}
|
||||||
|
if(!CheckField('address','Address is mandatory')) {return;}
|
||||||
|
print();
|
||||||
|
}
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// Add Javascript code
|
||||||
|
$pdf->IncludeJS($js);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_014.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
161
TCPDF/examples/example_015.php
Normal file
161
TCPDF/examples/example_015.php
Normal file
|
@ -0,0 +1,161 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_015.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 015 for TCPDF class
|
||||||
|
// Bookmarks (Table of Content)
|
||||||
|
// and Named Destinations.
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Bookmarks (Table of Content)
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 015');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 015', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// Bookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0))
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set a bookmark for the current position
|
||||||
|
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128));
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->SetFont('times', 'I', 14);
|
||||||
|
$pdf->Write(0, 'You can set PDF Bookmarks using the Bookmark() method.
|
||||||
|
You can set PDF Named Destinations using the setDestination() method.');
|
||||||
|
|
||||||
|
$pdf->SetFont('times', 'B', 20);
|
||||||
|
|
||||||
|
// add other pages and bookmarks
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(0,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(0,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(0,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
// add a named destination so you can open this document at this page using the link: "example_015.pdf#chapter2"
|
||||||
|
$pdf->setDestination('chapter2', 0, '');
|
||||||
|
// add a bookmark that points to a named destination
|
||||||
|
$pdf->Bookmark('Chapter 2', 0, 0, '', 'BI', array(128,0,0), -1, '#chapter2');
|
||||||
|
$pdf->Cell(0, 10, 'Chapter 2', 0, 1, 'L');
|
||||||
|
$pdf->SetFont('times', 'I', 14);
|
||||||
|
$pdf->Write(0, 'Once saved, you can open this document at this page using the link: "example_015.pdf#chapter2".');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->setDestination('chapter3', 0, '');
|
||||||
|
$pdf->SetFont('times', 'B', 20);
|
||||||
|
$pdf->Bookmark('Chapter 3', 0, 0, '', 'B', array(0,64,128));
|
||||||
|
$pdf->Cell(0, 10, 'Chapter 3', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->setDestination('chapter4', 0, '');
|
||||||
|
$pdf->SetFont('times', 'B', 20);
|
||||||
|
$pdf->Bookmark('Chapter 4', 0, 0, '', 'B', array(0,64,128));
|
||||||
|
$pdf->Cell(0, 10, 'Chapter 4', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Chapter 5', 0, 0, '', 'B', array(0,128,0));
|
||||||
|
$pdf->Cell(0, 10, 'Chapter 5', 0, 1, 'L');
|
||||||
|
$txt = 'Example of File Attachment.
|
||||||
|
Double click on the icon to open the attached file.';
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// attach an external file TXT file
|
||||||
|
$pdf->Annotation(20, 50, 5, 5, 'TXT file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt'));
|
||||||
|
|
||||||
|
// attach an external file
|
||||||
|
$pdf->Annotation(50, 50, 5, 5, 'PDF file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'example_012.pdf'));
|
||||||
|
|
||||||
|
// add a bookmark that points to an embedded file
|
||||||
|
// NOTE: prefix the file name with the * character for generic file and with % character for PDF file
|
||||||
|
$pdf->Bookmark('TXT file', 0, 0, '', 'B', array(128,0,255), -1, '*utf8test.txt');
|
||||||
|
|
||||||
|
// add a bookmark that points to an embedded file
|
||||||
|
// NOTE: prefix the file name with the * character for generic file and with % character for PDF file
|
||||||
|
$pdf->Bookmark('PDF file', 0, 0, '', 'B', array(128,0,255), -1, '%example_012.pdf');
|
||||||
|
|
||||||
|
// add a bookmark that points to an external URL
|
||||||
|
$pdf->Bookmark('External URL', 0, 0, '', 'B', array(0,0,255), -1, 'http://www.tcpdf.org');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_015.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
134
TCPDF/examples/example_016.php
Normal file
134
TCPDF/examples/example_016.php
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_016.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 016 for TCPDF class
|
||||||
|
// Document Encryption / Security
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Document Encryption / Security
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
|
||||||
|
// *** Set PDF protection (encryption) *********************
|
||||||
|
|
||||||
|
/*
|
||||||
|
The permission array is composed of values taken from the following ones (specify the ones you want to block):
|
||||||
|
- print : Print the document;
|
||||||
|
- modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
|
||||||
|
- copy : Copy or otherwise extract text and graphics from the document;
|
||||||
|
- annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
|
||||||
|
- fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
|
||||||
|
- extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
|
||||||
|
- assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
|
||||||
|
- print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
|
||||||
|
- owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
|
||||||
|
|
||||||
|
If you don't set any password, the document will open as usual.
|
||||||
|
If you set a user password, the PDF viewer will ask for it before displaying the document.
|
||||||
|
The master (owner) password, if different from the user one, can be used to get full document access.
|
||||||
|
|
||||||
|
Possible encryption modes are:
|
||||||
|
0 = RSA 40 bit
|
||||||
|
1 = RSA 128 bit
|
||||||
|
2 = AES 128 bit
|
||||||
|
3 = AES 256 bit
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
- To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
|
||||||
|
- To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
|
||||||
|
- To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$pdf->SetProtection(array('print', 'copy'), '', null, 0, null);
|
||||||
|
|
||||||
|
// Example with public-key
|
||||||
|
// To open the document you need to install the private key (tcpdf.p12) on the Acrobat Reader. The password is: 1234
|
||||||
|
//$pdf->SetProtection($permissions=array('print', 'copy'), $user_pass='', $owner_pass=null, $mode=1, $pubkeys=array(array('c' => 'file://../config/cert/tcpdf.crt', 'p' => array('print'))));
|
||||||
|
|
||||||
|
// *********************************************************
|
||||||
|
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 016');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 016', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array('helvetica', '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array('helvetica', '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 16);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set some text to print
|
||||||
|
$txt = <<<EOD
|
||||||
|
Encryption Example
|
||||||
|
|
||||||
|
Consult the source code documentation for the SetProtection() method.
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// print a block of text using Write()
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_016.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
117
TCPDF/examples/example_017.php
Normal file
117
TCPDF/examples/example_017.php
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_017.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 017 for TCPDF class
|
||||||
|
// Two independent columns with MultiCell
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Two independent columns with MultiCell
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 017');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 017', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of independent Multicell() columns', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$pdf->SetFont('times', '', 12);
|
||||||
|
|
||||||
|
// create columns content
|
||||||
|
// create columns content
|
||||||
|
$left_column = '[LEFT COLUMN] left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column'."\n";
|
||||||
|
|
||||||
|
$right_column = '[RIGHT COLUMN] right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column'."\n";
|
||||||
|
|
||||||
|
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(255, 255, 200);
|
||||||
|
|
||||||
|
// set color for text
|
||||||
|
$pdf->SetTextColor(0, 63, 127);
|
||||||
|
|
||||||
|
// write the first column
|
||||||
|
$pdf->MultiCell(80, 0, $left_column, 1, 'J', 1, 0, '', '', true, 0, false, true, 0);
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(215, 235, 255);
|
||||||
|
|
||||||
|
// set color for text
|
||||||
|
$pdf->SetTextColor(127, 31, 0);
|
||||||
|
|
||||||
|
// write the second column
|
||||||
|
$pdf->MultiCell(80, 0, $right_column, 1, 'J', 1, 1, '', '', true, 0, false, true, 0);
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_017.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
128
TCPDF/examples/example_018.php
Normal file
128
TCPDF/examples/example_018.php
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_018.php
|
||||||
|
// Begin : 2008-03-06
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 018 for TCPDF class
|
||||||
|
// RTL document with Persian language
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: RTL document with Persian language
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-06
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 018');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 018', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language dependent data:
|
||||||
|
$lg = Array();
|
||||||
|
$lg['a_meta_charset'] = 'UTF-8';
|
||||||
|
$lg['a_meta_dir'] = 'rtl';
|
||||||
|
$lg['a_meta_language'] = 'fa';
|
||||||
|
$lg['w_page'] = 'page';
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
$pdf->setLanguageArray($lg);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('dejavusans', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// Persian and English content
|
||||||
|
$htmlpersian = '<span color="#660000">Persian example:</span><br />سلام بالاخره مشکل PDF فارسی به طور کامل حل شد. اینم یک نمونش.<br />مشکل حرف \"ژ\" در بعضی کلمات مانند کلمه ویژه نیز بر طرف شد.<br />نگارش حروف لام و الف پشت سر هم نیز تصحیح شد.<br />با تشکر از "Asuni Nicola" و محمد علی گل کار برای پشتیبانی زبان فارسی.';
|
||||||
|
$pdf->WriteHTML($htmlpersian, true, 0, true, 0);
|
||||||
|
|
||||||
|
// set LTR direction for english translation
|
||||||
|
$pdf->setRTL(false);
|
||||||
|
|
||||||
|
$pdf->SetFontSize(10);
|
||||||
|
|
||||||
|
// print newline
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// Persian and English content
|
||||||
|
$htmlpersiantranslation = '<span color="#0000ff">Hi, At last Problem of Persian PDF Solved completely. This is a example for it.<br />Problem of "jeh" letter in some word like "ویژه" (=special) fix too.<br />The joining of laa and alf letter fix now.<br />Special thanks to "Nicola Asuni" and "Mohamad Ali Golkar" for Persian support.</span>';
|
||||||
|
$pdf->WriteHTML($htmlpersiantranslation, true, 0, true, 0);
|
||||||
|
|
||||||
|
// Restore RTL direction
|
||||||
|
$pdf->setRTL(true);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('aefurat', '', 18);
|
||||||
|
|
||||||
|
// print newline
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// Arabic and English content
|
||||||
|
$pdf->Cell(0, 12, 'بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ',0,1,'C');
|
||||||
|
$htmlcontent = 'تمَّ بِحمد الله حلّ مشكلة الكتابة باللغة العربية في ملفات الـ<span color="#FF0000">PDF</span> مع دعم الكتابة <span color="#0000FF">من اليمين إلى اليسار</span> و<span color="#009900">الحركَات</span> .<br />تم الحل بواسطة <span color="#993399">صالح المطرفي و Asuni Nicola</span> . ';
|
||||||
|
$pdf->WriteHTML($htmlcontent, true, 0, true, 0);
|
||||||
|
|
||||||
|
// set LTR direction for english translation
|
||||||
|
$pdf->setRTL(false);
|
||||||
|
|
||||||
|
// print newline
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
$pdf->SetFont('aealarabiya', '', 18);
|
||||||
|
|
||||||
|
// Arabic and English content
|
||||||
|
$htmlcontent2 = '<span color="#0000ff">This is Arabic "العربية" Example With TCPDF.</span>';
|
||||||
|
$pdf->WriteHTML($htmlcontent2, true, 0, true, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_018.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
98
TCPDF/examples/example_019.php
Normal file
98
TCPDF/examples/example_019.php
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_019.php
|
||||||
|
// Begin : 2008-03-07
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 019 for TCPDF class
|
||||||
|
// Non unicode with alternative config file
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Non unicode with alternative config file
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false);
|
||||||
|
|
||||||
|
// Set document information dictionary in unicode mode
|
||||||
|
$pdf->SetDocInfoUnicode(true);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni [€]');
|
||||||
|
$pdf->SetTitle('TCPDF Example 019');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 019', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language dependent data:
|
||||||
|
$lg = Array();
|
||||||
|
$lg['a_meta_charset'] = 'ISO-8859-1';
|
||||||
|
$lg['a_meta_dir'] = 'ltr';
|
||||||
|
$lg['a_meta_language'] = 'en';
|
||||||
|
$lg['w_page'] = 'page';
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
$pdf->setLanguageArray($lg);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(200, 255, 200);
|
||||||
|
|
||||||
|
$txt = 'An alternative configuration file is used on this example.
|
||||||
|
Check the definition of the K_TCPDF_EXTERNAL_CONFIG constant on the source code.';
|
||||||
|
|
||||||
|
// print some text
|
||||||
|
$pdf->MultiCell(0, 0, $txt."\n", 1, 'J', 1, 1, '', '', true, 0, false, true, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_019.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
146
TCPDF/examples/example_020.php
Normal file
146
TCPDF/examples/example_020.php
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_020.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 020 for TCPDF class
|
||||||
|
// Two columns composed by MultiCell of different
|
||||||
|
// heights
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Two columns composed by MultiCell of different heights
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// extend TCPF with custom functions
|
||||||
|
class MYPDF extends TCPDF {
|
||||||
|
|
||||||
|
public function MultiRow($left, $right) {
|
||||||
|
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0)
|
||||||
|
|
||||||
|
$page_start = $this->getPage();
|
||||||
|
$y_start = $this->GetY();
|
||||||
|
|
||||||
|
// write the left cell
|
||||||
|
$this->MultiCell(40, 0, $left, 1, 'R', 1, 2, '', '', true, 0);
|
||||||
|
|
||||||
|
$page_end_1 = $this->getPage();
|
||||||
|
$y_end_1 = $this->GetY();
|
||||||
|
|
||||||
|
$this->setPage($page_start);
|
||||||
|
|
||||||
|
// write the right cell
|
||||||
|
$this->MultiCell(0, 0, $right, 1, 'J', 0, 1, $this->GetX() ,$y_start, true, 0);
|
||||||
|
|
||||||
|
$page_end_2 = $this->getPage();
|
||||||
|
$y_end_2 = $this->GetY();
|
||||||
|
|
||||||
|
// set the new row position by case
|
||||||
|
if (max($page_end_1,$page_end_2) == $page_start) {
|
||||||
|
$ynew = max($y_end_1, $y_end_2);
|
||||||
|
} elseif ($page_end_1 == $page_end_2) {
|
||||||
|
$ynew = max($y_end_1, $y_end_2);
|
||||||
|
} elseif ($page_end_1 > $page_end_2) {
|
||||||
|
$ynew = $y_end_1;
|
||||||
|
} else {
|
||||||
|
$ynew = $y_end_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setPage(max($page_end_1,$page_end_2));
|
||||||
|
$this->SetXY($this->GetX(),$ynew);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 020');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 020', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 20);
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of text layout using Multicell()', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$pdf->SetFont('times', '', 9);
|
||||||
|
|
||||||
|
//$pdf->SetCellPadding(0);
|
||||||
|
//$pdf->SetLineWidth(2);
|
||||||
|
|
||||||
|
// set color for background
|
||||||
|
$pdf->SetFillColor(255, 255, 200);
|
||||||
|
|
||||||
|
$text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
|
||||||
|
|
||||||
|
Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.';
|
||||||
|
|
||||||
|
// print some rows just as example
|
||||||
|
for ($i = 0; $i < 10; ++$i) {
|
||||||
|
$pdf->MultiRow('Row '.($i+1), $text."\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_020.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
91
TCPDF/examples/example_021.php
Normal file
91
TCPDF/examples/example_021.php
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_021.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 021 for TCPDF class
|
||||||
|
// WriteHTML text flow
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: WriteHTML text flow.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 021');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 021', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 9);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$html = '<h1>Example of HTML text flow</h1>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. <em>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?</em> <em>Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</em><br /><br /><b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i><br /><br /><b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u>';
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, 0, true, 0);
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_021.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
146
TCPDF/examples/example_022.php
Normal file
146
TCPDF/examples/example_022.php
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_022.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 022 for TCPDF class
|
||||||
|
// CMYK colors
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: CMYK colors.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 022');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 022', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// check also the following methods:
|
||||||
|
// SetDrawColorArray()
|
||||||
|
// SetFillColorArray()
|
||||||
|
// SetTextColorArray()
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 18);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of CMYK, RGB and Grayscale colours', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// define style for border
|
||||||
|
$border_style = array('all' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0));
|
||||||
|
|
||||||
|
// --- CMYK ------------------------------------------------
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(50, 0, 0, 0);
|
||||||
|
$pdf->SetFillColor(100, 0, 0, 0);
|
||||||
|
$pdf->SetTextColor(100, 0, 0, 0);
|
||||||
|
$pdf->Rect(30, 60, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(30, 92, 'Cyan');
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(0, 50, 0, 0);
|
||||||
|
$pdf->SetFillColor(0, 100, 0, 0);
|
||||||
|
$pdf->SetTextColor(0, 100, 0, 0);
|
||||||
|
$pdf->Rect(70, 60, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(70, 92, 'Magenta');
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(0, 0, 50, 0);
|
||||||
|
$pdf->SetFillColor(0, 0, 100, 0);
|
||||||
|
$pdf->SetTextColor(0, 0, 100, 0);
|
||||||
|
$pdf->Rect(110, 60, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(110, 92, 'Yellow');
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(0, 0, 0, 50);
|
||||||
|
$pdf->SetFillColor(0, 0, 0, 100);
|
||||||
|
$pdf->SetTextColor(0, 0, 0, 100);
|
||||||
|
$pdf->Rect(150, 60, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(150, 92, 'Black');
|
||||||
|
|
||||||
|
// --- RGB -------------------------------------------------
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(255, 127, 127);
|
||||||
|
$pdf->SetFillColor(255, 0, 0);
|
||||||
|
$pdf->SetTextColor(255, 0, 0);
|
||||||
|
$pdf->Rect(30, 110, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(30, 142, 'Red');
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(127, 255, 127);
|
||||||
|
$pdf->SetFillColor(0, 255, 0);
|
||||||
|
$pdf->SetTextColor(0, 255, 0);
|
||||||
|
$pdf->Rect(70, 110, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(70, 142, 'Green');
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(127, 127, 255);
|
||||||
|
$pdf->SetFillColor(0, 0, 255);
|
||||||
|
$pdf->SetTextColor(0, 0, 255);
|
||||||
|
$pdf->Rect(110, 110, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(110, 142, 'Blue');
|
||||||
|
|
||||||
|
// --- GRAY ------------------------------------------------
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(191);
|
||||||
|
$pdf->SetFillColor(127);
|
||||||
|
$pdf->SetTextColor(127);
|
||||||
|
$pdf->Rect(30, 160, 30, 30, 'DF', $border_style);
|
||||||
|
$pdf->Text(30, 192, 'Gray');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_022.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
113
TCPDF/examples/example_023.php
Normal file
113
TCPDF/examples/example_023.php
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_023.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 023 for TCPDF class
|
||||||
|
// Page Groups
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Page Groups.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 023');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 023', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'BI', 14);
|
||||||
|
|
||||||
|
// Start First Page Group
|
||||||
|
$pdf->startPageGroup();
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set some text to print
|
||||||
|
$txt = <<<EOD
|
||||||
|
Example of page groups.
|
||||||
|
Check the page numbers on the page footer.
|
||||||
|
|
||||||
|
This is the first page of group 1.
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// print a block of text using Write()
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// add second page
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'This is the second page of group 1', 0, 1, 'L');
|
||||||
|
|
||||||
|
// Start Second Page Group
|
||||||
|
$pdf->startPageGroup();
|
||||||
|
|
||||||
|
// add some pages
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'This is the first page of group 2', 0, 1, 'L');
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'This is the second page of group 2', 0, 1, 'L');
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'This is the third page of group 2', 0, 1, 'L');
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'This is the fourth page of group 2', 0, 1, 'L');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_023.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
140
TCPDF/examples/example_024.php
Normal file
140
TCPDF/examples/example_024.php
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_024.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 024 for TCPDF class
|
||||||
|
// Object Visibility and Layers
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Object Visibility and Layers
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 024');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 024', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 18);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* setVisibility() allows to restrict the rendering of some
|
||||||
|
* elements to screen or printout. This can be useful, for
|
||||||
|
* instance, to put a background image or color that will
|
||||||
|
* show on screen but won't print.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$txt = 'You can limit the visibility of PDF objects to screen or printer by using the setVisibility() method.
|
||||||
|
Check the print preview of this document to display the alternative text.';
|
||||||
|
|
||||||
|
$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// change font size
|
||||||
|
$pdf->SetFontSize(40);
|
||||||
|
|
||||||
|
// change text color
|
||||||
|
$pdf->SetTextColor(0,63,127);
|
||||||
|
|
||||||
|
// set visibility only for screen
|
||||||
|
$pdf->setVisibility('screen');
|
||||||
|
|
||||||
|
// write something only for screen
|
||||||
|
$pdf->Write(0, '[This line is for display]', '', 0, 'C', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// set visibility only for print
|
||||||
|
$pdf->setVisibility('print');
|
||||||
|
|
||||||
|
// change text color
|
||||||
|
$pdf->SetTextColor(127,0,0);
|
||||||
|
|
||||||
|
// write something only for print
|
||||||
|
$pdf->Write(0, '[This line is for printout]', '', 0, 'C', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// restore visibility
|
||||||
|
$pdf->setVisibility('all');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// LAYERS
|
||||||
|
|
||||||
|
// start a new layer
|
||||||
|
$pdf->startLayer('layer1', true, true);
|
||||||
|
|
||||||
|
// change font size
|
||||||
|
$pdf->SetFontSize(18);
|
||||||
|
|
||||||
|
// change text color
|
||||||
|
$pdf->SetTextColor(0,127,0);
|
||||||
|
|
||||||
|
$txt = 'Using the startLayer() method you can group PDF objects into layers.
|
||||||
|
This text is on "layer1".';
|
||||||
|
|
||||||
|
// write something
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// close the current layer
|
||||||
|
$pdf->endLayer();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_024.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
118
TCPDF/examples/example_025.php
Normal file
118
TCPDF/examples/example_025.php
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_025.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 025 for TCPDF class
|
||||||
|
// Object Transparency
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Object Transparency
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 025');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 025', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$txt = 'You can set the transparency of PDF objects using the setAlpha() method.';
|
||||||
|
$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* setAlpha() gives transparency support. You can set the
|
||||||
|
* alpha channel from 0 (fully transparent) to 1 (fully
|
||||||
|
* opaque). It applies to all elements (text, drawings,
|
||||||
|
* images).
|
||||||
|
*/
|
||||||
|
|
||||||
|
$pdf->SetLineWidth(2);
|
||||||
|
|
||||||
|
// draw opaque red square
|
||||||
|
$pdf->SetFillColor(255, 0, 0);
|
||||||
|
$pdf->SetDrawColor(127, 0, 0);
|
||||||
|
$pdf->Rect(30, 40, 60, 60, 'DF');
|
||||||
|
|
||||||
|
// set alpha to semi-transparency
|
||||||
|
$pdf->SetAlpha(0.5);
|
||||||
|
|
||||||
|
// draw green square
|
||||||
|
$pdf->SetFillColor(0, 255, 0);
|
||||||
|
$pdf->SetDrawColor(0, 127, 0);
|
||||||
|
$pdf->Rect(50, 60, 60, 60, 'DF');
|
||||||
|
|
||||||
|
// draw blue square
|
||||||
|
$pdf->SetFillColor(0, 0, 255);
|
||||||
|
$pdf->SetDrawColor(0, 0, 127);
|
||||||
|
$pdf->Rect(70, 80, 60, 60, 'DF');
|
||||||
|
|
||||||
|
// draw jpeg image
|
||||||
|
$pdf->Image('images/image_demo.jpg', 90, 100, 60, 60, '', 'http://www.tcpdf.org', '', true, 72);
|
||||||
|
|
||||||
|
// restore full opacity
|
||||||
|
$pdf->SetAlpha(1);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_025.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
145
TCPDF/examples/example_026.php
Normal file
145
TCPDF/examples/example_026.php
Normal file
|
@ -0,0 +1,145 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_026.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 026 for TCPDF class
|
||||||
|
// Text Rendering Modes and Text Clipping
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Text Rendering Modes and Text Clipping
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 026');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 026', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 22);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set color for text stroke
|
||||||
|
$pdf->SetDrawColor(255,0,0);
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->setTextRenderingMode($stroke=0, $fill=true, $clip=false);
|
||||||
|
$pdf->Write(0, 'Fill text', '', 0, '', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->setTextRenderingMode($stroke=0.2, $fill=false, $clip=false);
|
||||||
|
$pdf->Write(0, 'Stroke text', '', 0, '', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->setTextRenderingMode($stroke=0.2, $fill=true, $clip=false);
|
||||||
|
$pdf->Write(0, 'Fill, then stroke text', '', 0, '', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->setTextRenderingMode($stroke=0, $fill=false, $clip=false);
|
||||||
|
$pdf->Write(0, 'Neither fill nor stroke text (invisible)', '', 0, '', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * CLIPPING MODES * * * * * * * * * * * * * * * * * *
|
||||||
|
|
||||||
|
$pdf->StartTransform();
|
||||||
|
$pdf->setTextRenderingMode($stroke=0, $fill=true, $clip=true);
|
||||||
|
$pdf->Write(0, 'Fill text and add to path for clipping', '', 0, '', true, 0, false, false, 0);
|
||||||
|
$pdf->Image('images/image_demo.jpg', 15, 65, 170, 10, '', '', '', true, 72);
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
$pdf->StartTransform();
|
||||||
|
$pdf->setTextRenderingMode($stroke=0.3, $fill=false, $clip=true);
|
||||||
|
$pdf->Write(0, 'Stroke text and add to path for clipping', '', 0, '', true, 0, false, false, 0);
|
||||||
|
$pdf->Image('images/image_demo.jpg', 15, 75, 170, 10, '', '', '', true, 72);
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
$pdf->StartTransform();
|
||||||
|
$pdf->setTextRenderingMode($stroke=0.3, $fill=true, $clip=true);
|
||||||
|
$pdf->Write(0, 'Fill, then stroke text and add to path for clipping', '', 0, '', true, 0, false, false, 0);
|
||||||
|
$pdf->Image('images/image_demo.jpg', 15, 85, 170, 10, '', '', '', true, 72);
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
$pdf->StartTransform();
|
||||||
|
$pdf->setTextRenderingMode($stroke=0, $fill=false, $clip=true);
|
||||||
|
$pdf->Write(0, 'Add text to path for clipping', '', 0, '', true, 0, false, false, 0);
|
||||||
|
$pdf->Image('images/image_demo.jpg', 15, 95, 170, 10, '', '', '', true, 72);
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// reset text rendering mode
|
||||||
|
$pdf->setTextRenderingMode($stroke=0, $fill=true, $clip=false);
|
||||||
|
|
||||||
|
// * * * HTML MODE * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
|
||||||
|
// The following attributes were added to HTML:
|
||||||
|
// stroke : stroke width
|
||||||
|
// strokecolor : stroke color
|
||||||
|
// fill : true (default) to fill the font, false otherwise
|
||||||
|
|
||||||
|
|
||||||
|
// create some HTML content with text rendering modes
|
||||||
|
$html = '<span stroke="0" fill="true">HTML Fill text</span><br />';
|
||||||
|
$html .= '<span stroke="0.2" fill="false">HTML Stroke text</span><br />';
|
||||||
|
$html .= '<span stroke="0.2" fill="true" strokecolor="#FF0000" color="#FFFF00">HTML Fill, then stroke text</span><br />';
|
||||||
|
$html .= '<span stroke="0" fill="false">HTML Neither fill nor stroke text (invisible)</span><br />';
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, 0, true, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_026.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
418
TCPDF/examples/example_027.php
Normal file
418
TCPDF/examples/example_027.php
Normal file
|
@ -0,0 +1,418 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_027.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 027 for TCPDF class
|
||||||
|
// 1D Barcodes
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: 1D Barcodes.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 027');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 027', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set a barcode on the page footer
|
||||||
|
$pdf->setBarcode(date('Y-m-d H:i:s'));
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 11);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a message
|
||||||
|
$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
|
||||||
|
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
|
||||||
|
$pdf->SetY(30);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// define barcode style
|
||||||
|
$style = array(
|
||||||
|
'position' => '',
|
||||||
|
'align' => 'C',
|
||||||
|
'stretch' => false,
|
||||||
|
'fitwidth' => true,
|
||||||
|
'cellfitalign' => '',
|
||||||
|
'border' => true,
|
||||||
|
'hpadding' => 'auto',
|
||||||
|
'vpadding' => 'auto',
|
||||||
|
'fgcolor' => array(0,0,0),
|
||||||
|
'bgcolor' => false, //array(255,255,255),
|
||||||
|
'text' => true,
|
||||||
|
'font' => 'helvetica',
|
||||||
|
'fontsize' => 8,
|
||||||
|
'stretchtext' => 4
|
||||||
|
);
|
||||||
|
|
||||||
|
// PRINT VARIOUS 1D BARCODES
|
||||||
|
|
||||||
|
// CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
||||||
|
$pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 39 + CHECKSUM
|
||||||
|
$pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 39 EXTENDED
|
||||||
|
$pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 39 EXTENDED + CHECKSUM
|
||||||
|
$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 93 - USS-93
|
||||||
|
$pdf->Cell(0, 0, 'CODE 93 - USS-93', 0, 1);
|
||||||
|
$pdf->write1DBarcode('TEST93', 'C93', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// Standard 2 of 5
|
||||||
|
$pdf->Cell(0, 0, 'Standard 2 of 5', 0, 1);
|
||||||
|
$pdf->write1DBarcode('1234567', 'S25', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// Standard 2 of 5 + CHECKSUM
|
||||||
|
$pdf->Cell(0, 0, 'Standard 2 of 5 + CHECKSUM', 0, 1);
|
||||||
|
$pdf->write1DBarcode('1234567', 'S25+', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// Interleaved 2 of 5
|
||||||
|
$pdf->Cell(0, 0, 'Interleaved 2 of 5', 0, 1);
|
||||||
|
$pdf->write1DBarcode('1234567', 'I25', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// Interleaved 2 of 5 + CHECKSUM
|
||||||
|
$pdf->Cell(0, 0, 'Interleaved 2 of 5 + CHECKSUM', 0, 1);
|
||||||
|
$pdf->write1DBarcode('1234567', 'I25+', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
|
||||||
|
// add a page ----------
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// CODE 128 AUTO
|
||||||
|
$pdf->Cell(0, 0, 'CODE 128 AUTO', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 128 AUTO', 'C128', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 128 A
|
||||||
|
$pdf->Cell(0, 0, 'CODE 128 A', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 128 A', 'C128A', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 128 B
|
||||||
|
$pdf->Cell(0, 0, 'CODE 128 B', 0, 1);
|
||||||
|
$pdf->write1DBarcode('CODE 128 B', 'C128B', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 128 C
|
||||||
|
$pdf->Cell(0, 0, 'CODE 128 C', 0, 1);
|
||||||
|
$pdf->write1DBarcode('0123456789', 'C128C', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// EAN 8
|
||||||
|
$pdf->Cell(0, 0, 'EAN 8', 0, 1);
|
||||||
|
$pdf->write1DBarcode('1234567', 'EAN8', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// EAN 13
|
||||||
|
$pdf->Cell(0, 0, 'EAN 13', 0, 1);
|
||||||
|
$pdf->write1DBarcode('1234567890128', 'EAN13', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// UPC-A
|
||||||
|
$pdf->Cell(0, 0, 'UPC-A', 0, 1);
|
||||||
|
$pdf->write1DBarcode('12345678901', 'UPCA', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// UPC-E
|
||||||
|
$pdf->Cell(0, 0, 'UPC-E', 0, 1);
|
||||||
|
$pdf->write1DBarcode('04210000526', 'UPCE', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
// add a page ----------
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// 5-Digits UPC-Based Extension
|
||||||
|
$pdf->Cell(0, 0, '5-Digits UPC-Based Extension', 0, 1);
|
||||||
|
$pdf->write1DBarcode('51234', 'EAN5', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// 2-Digits UPC-Based Extension
|
||||||
|
$pdf->Cell(0, 0, '2-Digits UPC-Based Extension', 0, 1);
|
||||||
|
$pdf->write1DBarcode('34', 'EAN2', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// MSI
|
||||||
|
$pdf->Cell(0, 0, 'MSI', 0, 1);
|
||||||
|
$pdf->write1DBarcode('80523', 'MSI', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// MSI + CHECKSUM (module 11)
|
||||||
|
$pdf->Cell(0, 0, 'MSI + CHECKSUM (module 11)', 0, 1);
|
||||||
|
$pdf->write1DBarcode('80523', 'MSI+', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODABAR
|
||||||
|
$pdf->Cell(0, 0, 'CODABAR', 0, 1);
|
||||||
|
$pdf->write1DBarcode('123456789', 'CODABAR', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// CODE 11
|
||||||
|
$pdf->Cell(0, 0, 'CODE 11', 0, 1);
|
||||||
|
$pdf->write1DBarcode('123-456-789', 'CODE11', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// PHARMACODE
|
||||||
|
$pdf->Cell(0, 0, 'PHARMACODE', 0, 1);
|
||||||
|
$pdf->write1DBarcode('789', 'PHARMA', '', '', '', 18, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// PHARMACODE TWO-TRACKS
|
||||||
|
$pdf->Cell(0, 0, 'PHARMACODE TWO-TRACKS', 0, 1);
|
||||||
|
$pdf->write1DBarcode('105', 'PHARMA2T', '', '', '', 18, 2, $style, 'N');
|
||||||
|
|
||||||
|
// add a page ----------
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
||||||
|
$pdf->Cell(0, 0, 'IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200', 0, 1);
|
||||||
|
$pdf->write1DBarcode('01234567094987654321-01234567891', 'IMB', '', '', '', 15, 0.6, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// POSTNET
|
||||||
|
$pdf->Cell(0, 0, 'POSTNET', 0, 1);
|
||||||
|
$pdf->write1DBarcode('98000', 'POSTNET', '', '', '', 15, 0.6, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// PLANET
|
||||||
|
$pdf->Cell(0, 0, 'PLANET', 0, 1);
|
||||||
|
$pdf->write1DBarcode('98000', 'PLANET', '', '', '', 15, 0.6, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
|
||||||
|
$pdf->Cell(0, 0, 'RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)', 0, 1);
|
||||||
|
$pdf->write1DBarcode('SN34RD1A', 'RMS4CC', '', '', '', 15, 0.6, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// KIX (Klant index - Customer index)
|
||||||
|
$pdf->Cell(0, 0, 'KIX (Klant index - Customer index)', 0, 1);
|
||||||
|
$pdf->write1DBarcode('SN34RDX1A', 'KIX', '', '', '', 15, 0.6, $style, 'N');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// TEST BARCODE ALIGNMENTS
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set a background color
|
||||||
|
$style['bgcolor'] = array(255,255,240);
|
||||||
|
$style['fgcolor'] = array(127,0,0);
|
||||||
|
|
||||||
|
// Left position
|
||||||
|
$style['position'] = 'L';
|
||||||
|
$pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Center position
|
||||||
|
$style['position'] = 'C';
|
||||||
|
$pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Right position
|
||||||
|
$style['position'] = 'R';
|
||||||
|
$pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||||
|
|
||||||
|
$style['fgcolor'] = array(0,127,0);
|
||||||
|
$style['position'] = '';
|
||||||
|
$style['stretch'] = false; // disable stretch
|
||||||
|
$style['fitwidth'] = false; // disable fitwidth
|
||||||
|
|
||||||
|
// Left alignment
|
||||||
|
$style['align'] = 'L';
|
||||||
|
$pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Center alignment
|
||||||
|
$style['align'] = 'C';
|
||||||
|
$pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Right alignment
|
||||||
|
$style['align'] = 'R';
|
||||||
|
$pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||||
|
|
||||||
|
$style['fgcolor'] = array(0,64,127);
|
||||||
|
$style['position'] = '';
|
||||||
|
$style['stretch'] = false; // disable stretch
|
||||||
|
$style['fitwidth'] = true; // disable fitwidth
|
||||||
|
|
||||||
|
// Left alignment
|
||||||
|
$style['cellfitalign'] = 'L';
|
||||||
|
$pdf->write1DBarcode('LEFT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Center alignment
|
||||||
|
$style['cellfitalign'] = 'C';
|
||||||
|
$pdf->write1DBarcode('CENTER', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Right alignment
|
||||||
|
$style['cellfitalign'] = 'R';
|
||||||
|
$pdf->write1DBarcode('RIGHT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||||
|
|
||||||
|
$style['fgcolor'] = array(127,0,127);
|
||||||
|
|
||||||
|
// Left alignment
|
||||||
|
$style['position'] = 'L';
|
||||||
|
$pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Center alignment
|
||||||
|
$style['position'] = 'C';
|
||||||
|
$pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
// Right alignment
|
||||||
|
$style['position'] = 'R';
|
||||||
|
$pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// TEST BARCODE STYLE
|
||||||
|
|
||||||
|
// define barcode style
|
||||||
|
$style = array(
|
||||||
|
'position' => '',
|
||||||
|
'align' => '',
|
||||||
|
'stretch' => true,
|
||||||
|
'fitwidth' => false,
|
||||||
|
'cellfitalign' => '',
|
||||||
|
'border' => true,
|
||||||
|
'hpadding' => 'auto',
|
||||||
|
'vpadding' => 'auto',
|
||||||
|
'fgcolor' => array(0,0,128),
|
||||||
|
'bgcolor' => array(255,255,128),
|
||||||
|
'text' => true,
|
||||||
|
'label' => 'CUSTOM LABEL',
|
||||||
|
'font' => 'helvetica',
|
||||||
|
'fontsize' => 8,
|
||||||
|
'stretchtext' => 4
|
||||||
|
);
|
||||||
|
|
||||||
|
// CODE 39 EXTENDED + CHECKSUM
|
||||||
|
$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
|
||||||
|
$pdf->SetLineStyle(array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||||
|
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 120, 25, 0.4, $style, 'N');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_027.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
138
TCPDF/examples/example_028.php
Normal file
138
TCPDF/examples/example_028.php
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_028.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 028 for TCPDF class
|
||||||
|
// Changing page formats
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: changing page formats
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 028');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// remove default header/footer
|
||||||
|
$pdf->setPrintHeader(false);
|
||||||
|
$pdf->setPrintFooter(false);
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(10, PDF_MARGIN_TOP, 10);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
$pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'B', 20);
|
||||||
|
|
||||||
|
$pdf->AddPage('P', 'A4');
|
||||||
|
$pdf->Cell(0, 0, 'A4 PORTRAIT', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('L', 'A4');
|
||||||
|
$pdf->Cell(0, 0, 'A4 LANDSCAPE', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('P', 'A5');
|
||||||
|
$pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('L', 'A5');
|
||||||
|
$pdf->Cell(0, 0, 'A5 LANDSCAPE', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('P', 'A6');
|
||||||
|
$pdf->Cell(0, 0, 'A6 PORTRAIT', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('L', 'A6');
|
||||||
|
$pdf->Cell(0, 0, 'A6 LANDSCAPE', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('P', 'A7');
|
||||||
|
$pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->AddPage('L', 'A7');
|
||||||
|
$pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
|
||||||
|
|
||||||
|
|
||||||
|
// --- test backward editing ---
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->setPage(1, true);
|
||||||
|
$pdf->SetY(50);
|
||||||
|
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(2, true);
|
||||||
|
$pdf->SetY(50);
|
||||||
|
$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(3, true);
|
||||||
|
$pdf->SetY(50);
|
||||||
|
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(4, true);
|
||||||
|
$pdf->SetY(50);
|
||||||
|
$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(5, true);
|
||||||
|
$pdf->SetY(50);
|
||||||
|
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(6, true);
|
||||||
|
$pdf->SetY(50);
|
||||||
|
$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(7, true);
|
||||||
|
$pdf->SetY(40);
|
||||||
|
$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->setPage(8, true);
|
||||||
|
$pdf->SetY(40);
|
||||||
|
$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_028.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
124
TCPDF/examples/example_029.php
Normal file
124
TCPDF/examples/example_029.php
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_029.php
|
||||||
|
// Begin : 2008-06-09
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 029 for TCPDF class
|
||||||
|
// Set PDF viewer display preferences.
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Set PDF viewer display preferences.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-06-09
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 029');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 029', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set array for viewer preferences
|
||||||
|
$preferences = array(
|
||||||
|
'HideToolbar' => true,
|
||||||
|
'HideMenubar' => true,
|
||||||
|
'HideWindowUI' => true,
|
||||||
|
'FitWindow' => true,
|
||||||
|
'CenterWindow' => true,
|
||||||
|
'DisplayDocTitle' => true,
|
||||||
|
'NonFullScreenPageMode' => 'UseNone', // UseNone, UseOutlines, UseThumbs, UseOC
|
||||||
|
'ViewArea' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
|
||||||
|
'ViewClip' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
|
||||||
|
'PrintArea' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
|
||||||
|
'PrintClip' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
|
||||||
|
'PrintScaling' => 'AppDefault', // None, AppDefault
|
||||||
|
'Duplex' => 'DuplexFlipLongEdge', // Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge
|
||||||
|
'PickTrayByPDFSize' => true,
|
||||||
|
'PrintPageRange' => array(1,1,2,3),
|
||||||
|
'NumCopies' => 2
|
||||||
|
);
|
||||||
|
|
||||||
|
// Check the example n. 60 for advanced page settings
|
||||||
|
|
||||||
|
// set pdf viewer preferences
|
||||||
|
$pdf->setViewerPreferences($preferences);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 14);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a line
|
||||||
|
$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 1', 1, 1, 'C');
|
||||||
|
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$pdf->Write(0, 'You can use the setViewerPreferences() method to change viewer preferences.', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
// print a line
|
||||||
|
$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 2', 0, 0, 'C');
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
// print a line
|
||||||
|
$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 3', 0, 0, 'C');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_029.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
188
TCPDF/examples/example_030.php
Normal file
188
TCPDF/examples/example_030.php
Normal file
|
@ -0,0 +1,188 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_030.php
|
||||||
|
// Begin : 2008-06-09
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 030 for TCPDF class
|
||||||
|
// Colour gradients
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Colour gradients
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-06-09
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 030');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 030', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// --- first page ------------------------------------------
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Cell(0, 0, 'TCPDF Gradients', 0, 1, 'C', 0, '', 0, false, 'T', 'M');
|
||||||
|
|
||||||
|
// set colors for gradients (r,g,b) or (grey 0-255)
|
||||||
|
$red = array(255, 0, 0);
|
||||||
|
$blue = array(0, 0, 200);
|
||||||
|
$yellow = array(255, 255, 0);
|
||||||
|
$green = array(0, 255, 0);
|
||||||
|
$white = array(255);
|
||||||
|
$black = array(0);
|
||||||
|
|
||||||
|
// set the coordinates x1,y1,x2,y2 of the gradient (see linear_gradient_coords.jpg)
|
||||||
|
$coords = array(0, 0, 1, 0);
|
||||||
|
|
||||||
|
// paint a linear gradient
|
||||||
|
$pdf->LinearGradient(20, 45, 80, 80, $red, $blue, $coords);
|
||||||
|
|
||||||
|
// write label
|
||||||
|
$pdf->Text(20, 130, 'LinearGradient()');
|
||||||
|
|
||||||
|
// set the coordinates fx,fy,cx,cy,r of the gradient (see radial_gradient_coords.jpg)
|
||||||
|
$coords = array(0.5, 0.5, 1, 1, 1.2);
|
||||||
|
|
||||||
|
// paint a radial gradient
|
||||||
|
$pdf->RadialGradient(110, 45, 80, 80, $white, $black, $coords);
|
||||||
|
|
||||||
|
// write label
|
||||||
|
$pdf->Text(110, 130, 'RadialGradient()');
|
||||||
|
|
||||||
|
// paint a coons patch mesh with default coordinates
|
||||||
|
$pdf->CoonsPatchMesh(20, 155, 80, 80, $yellow, $blue, $green, $red);
|
||||||
|
|
||||||
|
// write label
|
||||||
|
$pdf->Text(20, 240, 'CoonsPatchMesh()');
|
||||||
|
|
||||||
|
// set the coordinates for the cubic Bézier points x1,y1 ... x12, y12 of the patch (see coons_patch_mesh_coords.jpg)
|
||||||
|
$coords = array(
|
||||||
|
0.00,0.00, 0.33,0.20, //lower left
|
||||||
|
0.67,0.00, 1.00,0.00, 0.80,0.33, //lower right
|
||||||
|
0.80,0.67, 1.00,1.00, 0.67,0.80, //upper right
|
||||||
|
0.33,1.00, 0.00,1.00, 0.20,0.67, //upper left
|
||||||
|
0.00,0.33); //lower left
|
||||||
|
$coords_min = 0; //minimum value of the coordinates
|
||||||
|
$coords_max = 1; //maximum value of the coordinates
|
||||||
|
|
||||||
|
// paint a coons patch gradient with the above coordinates
|
||||||
|
$pdf->CoonsPatchMesh(110, 155, 80, 80, $yellow, $blue, $green, $red, $coords, $coords_min, $coords_max);
|
||||||
|
|
||||||
|
// write label
|
||||||
|
$pdf->Text(110, 240, 'CoonsPatchMesh()');
|
||||||
|
|
||||||
|
// --- second page -----------------------------------------
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// first patch: f = 0
|
||||||
|
$patch_array[0]['f'] = 0;
|
||||||
|
$patch_array[0]['points'] = array(
|
||||||
|
0.00,0.00, 0.33,0.00,
|
||||||
|
0.67,0.00, 1.00,0.00, 1.00,0.33,
|
||||||
|
0.8,0.67, 1.00,1.00, 0.67,0.8,
|
||||||
|
0.33,1.80, 0.00,1.00, 0.00,0.67,
|
||||||
|
0.00,0.33);
|
||||||
|
$patch_array[0]['colors'][0] = array('r' => 255, 'g' => 255, 'b' => 0);
|
||||||
|
$patch_array[0]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255);
|
||||||
|
$patch_array[0]['colors'][2] = array('r' => 0, 'g' => 255,'b' => 0);
|
||||||
|
$patch_array[0]['colors'][3] = array('r' => 255, 'g' => 0,'b' => 0);
|
||||||
|
|
||||||
|
// second patch - above the other: f = 2
|
||||||
|
$patch_array[1]['f'] = 2;
|
||||||
|
$patch_array[1]['points'] = array(
|
||||||
|
0.00,1.33,
|
||||||
|
0.00,1.67, 0.00,2.00, 0.33,2.00,
|
||||||
|
0.67,2.00, 1.00,2.00, 1.00,1.67,
|
||||||
|
1.5,1.33);
|
||||||
|
$patch_array[1]['colors'][0]=array('r' => 0, 'g' => 0, 'b' => 0);
|
||||||
|
$patch_array[1]['colors'][1]=array('r' => 255, 'g' => 0, 'b' => 255);
|
||||||
|
|
||||||
|
// third patch - right of the above: f = 3
|
||||||
|
$patch_array[2]['f'] = 3;
|
||||||
|
$patch_array[2]['points'] = array(
|
||||||
|
1.33,0.80,
|
||||||
|
1.67,1.50, 2.00,1.00, 2.00,1.33,
|
||||||
|
2.00,1.67, 2.00,2.00, 1.67,2.00,
|
||||||
|
1.33,2.00);
|
||||||
|
$patch_array[2]['colors'][0] = array('r' => 0, 'g' => 255, 'b' => 255);
|
||||||
|
$patch_array[2]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 0);
|
||||||
|
|
||||||
|
// fourth patch - below the above, which means left(?) of the above: f = 1
|
||||||
|
$patch_array[3]['f'] = 1;
|
||||||
|
$patch_array[3]['points'] = array(
|
||||||
|
2.00,0.67,
|
||||||
|
2.00,0.33, 2.00,0.00, 1.67,0.00,
|
||||||
|
1.33,0.00, 1.00,0.00, 1.00,0.33,
|
||||||
|
0.8,0.67);
|
||||||
|
$patch_array[3]['colors'][0] = array('r' => 0, 'g' => 0, 'b' => 0);
|
||||||
|
$patch_array[3]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255);
|
||||||
|
|
||||||
|
$coords_min = 0;
|
||||||
|
$coords_max = 2;
|
||||||
|
|
||||||
|
$pdf->CoonsPatchMesh(10, 45, 190, 200, '', '', '', '', $patch_array, $coords_min, $coords_max);
|
||||||
|
|
||||||
|
// write label
|
||||||
|
$pdf->Text(10, 250, 'CoonsPatchMesh()');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_030.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
103
TCPDF/examples/example_031.php
Normal file
103
TCPDF/examples/example_031.php
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_031.php
|
||||||
|
// Begin : 2008-06-09
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 031 for TCPDF class
|
||||||
|
// Pie Chart
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Pie Chart
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-06-09
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 031');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 031', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of PieSector() method.');
|
||||||
|
|
||||||
|
$xc = 105;
|
||||||
|
$yc = 100;
|
||||||
|
$r = 50;
|
||||||
|
|
||||||
|
$pdf->SetFillColor(0, 0, 255);
|
||||||
|
$pdf->PieSector($xc, $yc, $r, 20, 120, 'FD', false, 0, 2);
|
||||||
|
|
||||||
|
$pdf->SetFillColor(0, 255, 0);
|
||||||
|
$pdf->PieSector($xc, $yc, $r, 120, 250, 'FD', false, 0, 2);
|
||||||
|
|
||||||
|
$pdf->SetFillColor(255, 0, 0);
|
||||||
|
$pdf->PieSector($xc, $yc, $r, 250, 20, 'FD', false, 0, 2);
|
||||||
|
|
||||||
|
// write labels
|
||||||
|
$pdf->SetTextColor(255,255,255);
|
||||||
|
$pdf->Text(105, 65, 'BLUE');
|
||||||
|
$pdf->Text(60, 95, 'GREEN');
|
||||||
|
$pdf->Text(120, 115, 'RED');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_031.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
91
TCPDF/examples/example_032.php
Normal file
91
TCPDF/examples/example_032.php
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_032.php
|
||||||
|
// Begin : 2008-06-09
|
||||||
|
// Last Update : 2013-06-19
|
||||||
|
//
|
||||||
|
// Description : Example 032 for TCPDF class
|
||||||
|
// EPS/AI image
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: EPS/AI image
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-06-09
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 032');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 032', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 12);
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$html = <<<EOD
|
||||||
|
Example of ImageEPS() method for AI and EPS images<br />
|
||||||
|
NOTE: <i>Please use SVG format for a better vector support</i>.
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// Print text using writeHTMLCell()
|
||||||
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
|
||||||
|
|
||||||
|
$pdf->ImageEps('images/tcpdf_box.ai', 10, 40, 150, '', 'http://www.tcpdf.org', true, '', '', 0, false);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_032.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
105
TCPDF/examples/example_033.php
Normal file
105
TCPDF/examples/example_033.php
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_033.php
|
||||||
|
// Begin : 2008-06-24
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 033 for TCPDF class
|
||||||
|
// Mixed font types
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Mixed font types
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-06-24
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 033');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 033', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set default font subsetting mode
|
||||||
|
$pdf->setFontSubsetting(false);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Font Types', '', 0, 'C', 1, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(10);
|
||||||
|
|
||||||
|
$pdf->SetFont('times', '', 10);
|
||||||
|
|
||||||
|
$pdf->MultiCell(80, 0, "[Core font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
$pdf->SetFont('dejavusans', '', 10);
|
||||||
|
|
||||||
|
$pdf->MultiCell(80, 0, "[True Type Unicode font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(2);
|
||||||
|
|
||||||
|
$pdf->SetFont('cid0jp', '', 9);
|
||||||
|
|
||||||
|
$pdf->MultiCell(80, 0, "[CID-0 font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_033.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
96
TCPDF/examples/example_034.php
Normal file
96
TCPDF/examples/example_034.php
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_034.php
|
||||||
|
// Begin : 2008-07-18
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 034 for TCPDF class
|
||||||
|
// Clipping
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Clipping
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 034');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 034', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Image Clipping using geometric functions', '', 0, 'C', 1, 0, false, false, 0);
|
||||||
|
|
||||||
|
//Start Graphic Transformation
|
||||||
|
$pdf->StartTransform();
|
||||||
|
|
||||||
|
// set clipping mask
|
||||||
|
$pdf->StarPolygon(105, 100, 30, 10, 3, 0, 1, 'CNZ');
|
||||||
|
|
||||||
|
// draw jpeg image to be clipped
|
||||||
|
$pdf->Image('images/image_demo.jpg', 75, 70, 60, 60, '', 'http://www.tcpdf.org', '', true, 72);
|
||||||
|
|
||||||
|
//Stop Graphic Transformation
|
||||||
|
$pdf->StopTransform();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_034.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
111
TCPDF/examples/example_035.php
Normal file
111
TCPDF/examples/example_035.php
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_035.php
|
||||||
|
// Begin : 2008-07-22
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 035 for TCPDF class
|
||||||
|
// Line styles with cells and multicells
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Line styles with cells and multicells
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 035');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 035', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'BI', 16);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of SetLineStyle() method', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 4, 'color' => array(255, 0, 0)));
|
||||||
|
$pdf->SetFillColor(255,255,128);
|
||||||
|
$pdf->SetTextColor(0,0,128);
|
||||||
|
|
||||||
|
$text="DUMMY";
|
||||||
|
|
||||||
|
$pdf->Cell(0, 0, $text, 1, 1, 'L', 1, 0);
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 255)));
|
||||||
|
$pdf->SetFillColor(255,255,0);
|
||||||
|
$pdf->SetTextColor(0,0,255);
|
||||||
|
$pdf->MultiCell(60, 4, $text, 1, 'C', 1, 0);
|
||||||
|
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 255, 0)));
|
||||||
|
$pdf->SetFillColor(0,0,255);
|
||||||
|
$pdf->SetTextColor(255,255,0);
|
||||||
|
$pdf->MultiCell(60, 4, $text, 'TB', 'C', 1, 0);
|
||||||
|
|
||||||
|
$pdf->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 255)));
|
||||||
|
$pdf->SetFillColor(0,255,0);
|
||||||
|
$pdf->SetTextColor(255,0,255);
|
||||||
|
$pdf->MultiCell(60, 4, $text, 1, 'C', 1, 1);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_035.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
89
TCPDF/examples/example_036.php
Normal file
89
TCPDF/examples/example_036.php
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_036.php
|
||||||
|
// Begin : 2008-08-08
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 036 for TCPDF class
|
||||||
|
// Annotations
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Annotations
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-08-08
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 036');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 036', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 16);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$txt = 'Example of Text Annotation.
|
||||||
|
Move your mouse over the yellow box or double click on it to display the annotation text.';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// text annotation
|
||||||
|
$pdf->Annotation(83, 27, 10, 10, "Text annotation example\naccented letters test: àèéìòù", array('Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => array(255, 255, 0)));
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_036.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
147
TCPDF/examples/example_037.php
Normal file
147
TCPDF/examples/example_037.php
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_037.php
|
||||||
|
// Begin : 2008-09-12
|
||||||
|
// Last Update : 2013-09-30
|
||||||
|
//
|
||||||
|
// Description : Example 037 for TCPDF class
|
||||||
|
// Spot colors
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Spot colors.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-09-12
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 037');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 037', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 11);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$html = '<h1>Example of Spot Colors</h1>Spot colors are single ink colors, rather than colors produced by four (CMYK), six (CMYKOG) or more inks in the printing process (process colors). They can be obtained by special vendors, but often the printers have found their own way of mixing inks to match defined colors.<br /><br />As long as no open standard for spot colours exists, TCPDF users will have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly into the $spotcolor array in <b><em>include/tcpdf_colors.php</em></b> file, or define them using the <b><em>AddSpotColor()</em></b> method.<br /><br />Common industry standard spot colors are:<br /><span color="#008800">ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH</span>.';
|
||||||
|
|
||||||
|
// Print text using writeHTMLCell()
|
||||||
|
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, 'J', true);
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// Define some new spot colors
|
||||||
|
// $c, $m, $y and $k (2nd, 3rd, 4th and 5th parameter) are the CMYK color components.
|
||||||
|
// AddSpotColor($name, $c, $m, $y, $k)
|
||||||
|
|
||||||
|
$pdf->AddSpotColor('My TCPDF Dark Green', 100, 50, 80, 45);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Light Yellow', 0, 0, 55, 0);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Black', 0, 0, 0, 100);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Red', 30, 100, 90, 10);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Green', 100, 30, 100, 0);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Blue', 100, 60, 10, 5);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Yellow', 0, 20, 100, 0);
|
||||||
|
|
||||||
|
// Select the spot color
|
||||||
|
// $tint (the second parameter) is the intensity of the color (0-100).
|
||||||
|
// SetTextSpotColor($name, $tint=100)
|
||||||
|
// SetDrawSpotColor($name, $tint=100)
|
||||||
|
// SetFillSpotColor($name, $tint=100)
|
||||||
|
|
||||||
|
$pdf->SetTextSpotColor('My TCPDF Black', 100);
|
||||||
|
$pdf->SetDrawSpotColor('My TCPDF Black', 100);
|
||||||
|
|
||||||
|
$starty = 100;
|
||||||
|
|
||||||
|
// print some spot colors
|
||||||
|
|
||||||
|
$pdf->SetFillSpotColor('My TCPDF Dark Green', 100);
|
||||||
|
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||||
|
$pdf->Text(73, $starty + 8, 'My TCPDF Dark Green');
|
||||||
|
|
||||||
|
$starty += 24;
|
||||||
|
$pdf->SetFillSpotColor('My TCPDF Light Yellow', 100);
|
||||||
|
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||||
|
$pdf->Text(73, $starty + 8, 'My TCPDF Light Yellow');
|
||||||
|
|
||||||
|
|
||||||
|
// --- default values defined on spotcolors.php ---
|
||||||
|
|
||||||
|
$starty += 24;
|
||||||
|
$pdf->SetFillSpotColor('My TCPDF Red', 100);
|
||||||
|
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||||
|
$pdf->Text(73, $starty + 8, 'My TCPDF Red');
|
||||||
|
|
||||||
|
$starty += 24;
|
||||||
|
$pdf->SetFillSpotColor('My TCPDF Green', 100);
|
||||||
|
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||||
|
$pdf->Text(73, $starty + 8, 'My TCPDF Green');
|
||||||
|
|
||||||
|
$starty += 24;
|
||||||
|
$pdf->SetFillSpotColor('My TCPDF Blue', 100);
|
||||||
|
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||||
|
$pdf->Text(73, $starty + 8, 'My TCPDF Blue');
|
||||||
|
|
||||||
|
$starty += 24;
|
||||||
|
$pdf->SetFillSpotColor('My TCPDF Yellow', 100);
|
||||||
|
$pdf->Rect(30, $starty, 40, 20, 'DF');
|
||||||
|
$pdf->Text(73, $starty + 8, 'My TCPDF Yellow');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_037.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
92
TCPDF/examples/example_038.php
Normal file
92
TCPDF/examples/example_038.php
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_038.php
|
||||||
|
// Begin : 2008-09-15
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 038 for TCPDF class
|
||||||
|
// CID-0 CJK unembedded font
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: CID-0 CJK unembedded font
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-09-15
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 038');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 038', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$txt = 'Example of CID-0 CJK unembedded font.
|
||||||
|
To display extended text you must have CJK fonts installed for your PDF reader:';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('cid0jp', '', 40);
|
||||||
|
|
||||||
|
$txt = 'こんにちは世界';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_038.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
104
TCPDF/examples/example_039.php
Normal file
104
TCPDF/examples/example_039.php
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_039.php
|
||||||
|
// Begin : 2008-10-16
|
||||||
|
// Last Update : 2014-01-13
|
||||||
|
//
|
||||||
|
// Description : Example 039 for TCPDF class
|
||||||
|
// HTML justification
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: HTML justification
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-10-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 039');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 039', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$html = '<span style="text-align:justify;">a <u>abc</u> abcdefghijkl (abcdef) abcdefg <b>abcdefghi</b> a ((abc)) abcd <img src="images/logo_example.png" border="0" height="41" width="41" /> <img src="images/tcpdf_box.svg" alt="test alt attribute" width="80" height="60" border="0" /> abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a <u>abc</u> abcd abcdef abcdefg <b>abcdefghi</b> a abc \(abcd\) abcdef abcdefg <b>abcdefghi</b> a abc \\\(abcd\\\) abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg abcdefghi a abc abcd <a href="http://tcpdf.org">abcdef abcdefg</a> start a abc before <span style="background-color:yellow">yellow color</span> after a abc abcd abcdef abcdefg abcdefghi a abc abcd end abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi<br />abcd abcdef abcdefg abcdefghi<br />abcd abcde abcdef</span>';
|
||||||
|
|
||||||
|
// set core font
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, 0, true, true);
|
||||||
|
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
// set UTF-8 Unicode font
|
||||||
|
$pdf->SetFont('dejavusans', '', 10);
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, 0, true, true);
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_039.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
116
TCPDF/examples/example_040.php
Normal file
116
TCPDF/examples/example_040.php
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_040.php
|
||||||
|
// Begin : 2008-10-28
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 040 for TCPDF class
|
||||||
|
// Booklet mode (double-sided pages)
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Booklet mode (double-sided pages)
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-10-28
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 040');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 040', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set display mode
|
||||||
|
$pdf->SetDisplayMode($zoom='fullpage', $layout='TwoColumnRight', $mode='UseNone');
|
||||||
|
|
||||||
|
// set pdf viewer preferences
|
||||||
|
$pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge'));
|
||||||
|
|
||||||
|
// set booklet mode
|
||||||
|
$pdf->SetBooklet(true, 10, 30);
|
||||||
|
|
||||||
|
// set core font
|
||||||
|
$pdf->SetFont('helvetica', '', 18);
|
||||||
|
|
||||||
|
// add a page (left page)
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of booklet mode', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->Cell(0, 0, 'PAGE 1', 1, 1, 'C');
|
||||||
|
|
||||||
|
|
||||||
|
// add a page (right page)
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->Cell(0, 0, 'PAGE 2', 1, 1, 'C');
|
||||||
|
|
||||||
|
|
||||||
|
// add a page (left page)
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->Cell(0, 0, 'PAGE 3', 1, 1, 'C');
|
||||||
|
|
||||||
|
// add a page (right page)
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->Cell(0, 0, 'PAGE 4', 1, 1, 'C');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_040.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
90
TCPDF/examples/example_041.php
Normal file
90
TCPDF/examples/example_041.php
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_041.php
|
||||||
|
// Begin : 2008-12-07
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 041 for TCPDF class
|
||||||
|
// Annotation - FileAttachment
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Annotation - FileAttachment
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-12-07
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 041');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 041', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 16);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
|
||||||
|
$txt = 'Example of File Attachment.
|
||||||
|
Double click on the icon to open the attached file.';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// attach an external file
|
||||||
|
$pdf->Annotation(85, 27, 5, 5, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt'));
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_041.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
102
TCPDF/examples/example_042.php
Normal file
102
TCPDF/examples/example_042.php
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_042.php
|
||||||
|
// Begin : 2008-12-23
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 042 for TCPDF class
|
||||||
|
// Test Image with alpha channel
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Test Image with alpha channel
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-12-23
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 042');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 042', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set JPEG quality
|
||||||
|
//$pdf->setJPEGQuality(75);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 18);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// create background text
|
||||||
|
$background_text = str_repeat('TCPDF test PNG Alpha Channel ', 50);
|
||||||
|
$pdf->MultiCell(0, 5, $background_text, 0, 'J', 0, 2, '', '', true, 0, false);
|
||||||
|
|
||||||
|
// --- Method (A) ------------------------------------------
|
||||||
|
// the Image() method recognizes the alpha channel embedded on the image:
|
||||||
|
|
||||||
|
$pdf->Image('images/image_with_alpha.png', 50, 50, 100, '', '', 'http://www.tcpdf.org', '', false, 300);
|
||||||
|
|
||||||
|
// --- Method (B) ------------------------------------------
|
||||||
|
// provide image + separate 8-bit mask
|
||||||
|
|
||||||
|
// first embed mask image (w, h, x and y will be ignored, the image will be scaled to the target image's size)
|
||||||
|
$mask = $pdf->Image('images/alpha.png', 50, 140, 100, '', '', '', '', false, 300, '', true);
|
||||||
|
|
||||||
|
// embed image, masked with previously embedded mask
|
||||||
|
$pdf->Image('images/img.png', 50, 140, 100, '', '', 'http://www.tcpdf.org', '', false, 300, '', false, $mask);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_042.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
85
TCPDF/examples/example_043.php
Normal file
85
TCPDF/examples/example_043.php
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_043.php
|
||||||
|
// Begin : 2009-01-02
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 043 for TCPDF class
|
||||||
|
// Disk caching
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Disk caching
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-01-02
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', true);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 043');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 043', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 16);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// Multicell test
|
||||||
|
$pdf->MultiCell(0, 0, 'DISK CACHING TEST: check the parameters of the class constructor.', 1, 'L', 0, 0, '', '', true);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_043.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
128
TCPDF/examples/example_044.php
Normal file
128
TCPDF/examples/example_044.php
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_044.php
|
||||||
|
// Begin : 2009-01-02
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 044 for TCPDF class
|
||||||
|
// Move, copy and delete pages
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Move, copy and delete pages
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-01-02
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 044');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 044', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 40);
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: A', 0, 1, 'L');
|
||||||
|
|
||||||
|
// add some vertical space
|
||||||
|
$pdf->Ln(10);
|
||||||
|
|
||||||
|
// print some text
|
||||||
|
$pdf->SetFont('times', 'I', 16);
|
||||||
|
$txt = 'TCPDF allows you to Copy, Move and Delete pages.';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', 'B', 40);
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: B', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: D', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: E', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: E-2', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: F', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: C', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: G', 0, 1, 'L');
|
||||||
|
|
||||||
|
// Move page 7 to page 3
|
||||||
|
$pdf->movePage(7, 3);
|
||||||
|
|
||||||
|
// Delete page 6
|
||||||
|
$pdf->deletePage(6);
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Cell(0, 10, 'PAGE: H', 0, 1, 'L');
|
||||||
|
|
||||||
|
// copy the second page
|
||||||
|
$pdf->copyPage(2);
|
||||||
|
|
||||||
|
// NOTE: to insert a page to a previous position, you can add a new page to the end of document and then move it using movePage().
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_044.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
140
TCPDF/examples/example_045.php
Normal file
140
TCPDF/examples/example_045.php
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_045.php
|
||||||
|
// Begin : 2008-03-04
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 045 for TCPDF class
|
||||||
|
// Bookmarks and Table of Content
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Bookmarks and Table of Content
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 045');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 045', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// set a bookmark for the current position
|
||||||
|
$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128));
|
||||||
|
|
||||||
|
// print a line using Cell()
|
||||||
|
$pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
|
||||||
|
|
||||||
|
// Create a fixed link to the first page using the * character
|
||||||
|
$index_link = $pdf->AddLink();
|
||||||
|
$pdf->SetLink($index_link, 0, '*1');
|
||||||
|
$pdf->Cell(0, 10, 'Link to INDEX', 0, 1, 'R', false, $index_link);
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(128,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(128,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,128,0));
|
||||||
|
$pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
|
||||||
|
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(128,0,0));
|
||||||
|
$pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
|
||||||
|
|
||||||
|
// fixed link to the first page using the * character
|
||||||
|
$html = '<a href="#*1" style="color:blue;">link to INDEX (page 1)</a>';
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
|
||||||
|
// add some pages and bookmarks
|
||||||
|
for ($i = 2; $i < 12; $i++) {
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pdf->Bookmark('Chapter '.$i, 0, 0, '', 'B', array(0,64,128));
|
||||||
|
$pdf->Cell(0, 10, 'Chapter '.$i, 0, 1, 'L');
|
||||||
|
}
|
||||||
|
|
||||||
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||||
|
|
||||||
|
// add a new page for TOC
|
||||||
|
$pdf->addTOCPage();
|
||||||
|
|
||||||
|
// write the TOC title
|
||||||
|
$pdf->SetFont('times', 'B', 16);
|
||||||
|
$pdf->MultiCell(0, 0, 'Table Of Content', 0, 'C', 0, 1, '', '', true, 0);
|
||||||
|
$pdf->Ln();
|
||||||
|
|
||||||
|
$pdf->SetFont('dejavusans', '', 12);
|
||||||
|
|
||||||
|
// add a simple Table Of Content at first page
|
||||||
|
// (check the example n. 59 for the HTML version)
|
||||||
|
$pdf->addTOC(1, 'courier', '.', 'INDEX', 'B', array(128,0,0));
|
||||||
|
|
||||||
|
// end of TOC page
|
||||||
|
$pdf->endTOCPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_045.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
123
TCPDF/examples/example_046.php
Normal file
123
TCPDF/examples/example_046.php
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_046.php
|
||||||
|
// Begin : 2009-02-28
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 046 for TCPDF class
|
||||||
|
// Text Hyphenation
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: text Hyphenation
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-02-28
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 046');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 046', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of Text Hyphenation', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(10);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Unicode Data for SHY:
|
||||||
|
Name : SOFT HYPHEN, commonly abbreviated as SHY
|
||||||
|
HTML Entity (decimal): ­
|
||||||
|
HTML Entity (hex): ­
|
||||||
|
HTML Entity (named): ­
|
||||||
|
How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]
|
||||||
|
UTF-8 (hex): 0xC2 0xAD (c2ad)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
// You can automatically add SOFT HYPHENS to your text using
|
||||||
|
// the hyphenateText() method, but this requires either an
|
||||||
|
// hyphenation pattern array of a hyphenation pattern TEX file.
|
||||||
|
// You can download hyphenation TEX patterns from:
|
||||||
|
// http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
|
||||||
|
|
||||||
|
// EXAMPLE:
|
||||||
|
|
||||||
|
$html = 'On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.';
|
||||||
|
|
||||||
|
$hyphen_patterns = $pdf->getHyphenPatternsFromTEX('hyphens/hyph-en-gb.tex');
|
||||||
|
|
||||||
|
$html = $pdf->hyphenateText($html, $hyphen_patterns, array(), 1, 2, 1, 8);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// HTML text with soft hyphens (­)
|
||||||
|
$html = 'On the other hand, we de­nounce with righ­teous in­dig­na­tion and dis­like men who are so be­guiled and de­mo­r­al­ized by the charms of plea­sure of the mo­ment, so blind­ed by de­sire, that they can­not fore­see the pain and trou­ble that are bound to en­sue; and equal blame be­longs to those who fail in their du­ty through weak­ness of will, which is the same as say­ing through shrink­ing from toil and pain. Th­ese cas­es are per­fect­ly sim­ple and easy to distin­guish. In a free hour, when our pow­er of choice is un­tram­melled and when noth­ing pre­vents our be­ing able to do what we like best, ev­ery plea­sure is to be wel­comed and ev­ery pain avoid­ed. But in cer­tain cir­cum­s­tances and ow­ing to the claims of du­ty or the obli­ga­tions of busi­ness it will fre­quent­ly oc­cur that plea­sures have to be re­pu­di­at­ed and an­noy­ances ac­cept­ed. The wise man there­fore al­ways holds in th­ese mat­ters to this prin­ci­ple of se­lec­tion: he re­jects plea­sures to se­cure other greater plea­sures, or else he en­dures pains to avoid worse pains.';
|
||||||
|
|
||||||
|
$pdf->SetFont('times', '', 10);
|
||||||
|
$pdf->SetDrawColor(255,0,0);
|
||||||
|
$pdf->SetTextColor(0,63,127);
|
||||||
|
|
||||||
|
// print a cell
|
||||||
|
$pdf->writeHTMLCell(50, 0, '', '', $html, 1, 1, 0, true, 'J');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_046.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
117
TCPDF/examples/example_047.php
Normal file
117
TCPDF/examples/example_047.php
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_047.php
|
||||||
|
// Begin : 2009-03-19
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 047 for TCPDF class
|
||||||
|
// Transactions
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Transactions
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-03-19
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 047');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 047', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 16);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$txt = 'Example of Transactions.
|
||||||
|
TCPDF allows you to undo some operations using the Transactions.
|
||||||
|
Check the source code for further information.';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$pdf->SetFont('times', '', 12);
|
||||||
|
|
||||||
|
// start transaction
|
||||||
|
$pdf->startTransaction();
|
||||||
|
|
||||||
|
$pdf->Write(0, "LINE 1\n");
|
||||||
|
$pdf->Write(0, "LINE 2\n");
|
||||||
|
|
||||||
|
// restarts transaction
|
||||||
|
$pdf->startTransaction();
|
||||||
|
|
||||||
|
$pdf->Write(0, "LINE 3\n");
|
||||||
|
$pdf->Write(0, "LINE 4\n");
|
||||||
|
|
||||||
|
// rolls back to the last (re)start
|
||||||
|
$pdf = $pdf->rollbackTransaction();
|
||||||
|
|
||||||
|
$pdf->Write(0, "LINE 5\n");
|
||||||
|
$pdf->Write(0, "LINE 6\n");
|
||||||
|
|
||||||
|
// start transaction
|
||||||
|
$pdf->startTransaction();
|
||||||
|
|
||||||
|
$pdf->Write(0, "LINE 7\n");
|
||||||
|
|
||||||
|
// commit transaction (actually just frees memory)
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_047.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
313
TCPDF/examples/example_048.php
Normal file
313
TCPDF/examples/example_048.php
Normal file
|
@ -0,0 +1,313 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_048.php
|
||||||
|
// Begin : 2009-03-20
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 048 for TCPDF class
|
||||||
|
// HTML tables and table headers
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: HTML tables and table headers
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-03-20
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 048');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 048', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of HTML tables', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 8);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table cellspacing="0" cellpadding="1" border="1">
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3">COL 1 - ROW 1<br />COLSPAN 3</td>
|
||||||
|
<td>COL 2 - ROW 1</td>
|
||||||
|
<td>COL 3 - ROW 1</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2">COL 2 - ROW 2 - COLSPAN 2<br />text line<br />text line<br />text line<br />text line</td>
|
||||||
|
<td>COL 3 - ROW 2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>COL 3 - ROW 3</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table cellspacing="0" cellpadding="1" border="1">
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3">COL 1 - ROW 1<br />COLSPAN 3<br />text line<br />text line<br />text line<br />text line<br />text line<br />text line</td>
|
||||||
|
<td>COL 2 - ROW 1</td>
|
||||||
|
<td>COL 3 - ROW 1</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2">COL 2 - ROW 2 - COLSPAN 2<br />text line<br />text line<br />text line<br />text line</td>
|
||||||
|
<td>COL 3 - ROW 2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>COL 3 - ROW 3</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table cellspacing="0" cellpadding="1" border="1">
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3">COL 1 - ROW 1<br />COLSPAN 3<br />text line<br />text line<br />text line<br />text line<br />text line<br />text line</td>
|
||||||
|
<td>COL 2 - ROW 1</td>
|
||||||
|
<td>COL 3 - ROW 1</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2">COL 2 - ROW 2 - COLSPAN 2<br />text line<br />text line<br />text line<br />text line</td>
|
||||||
|
<td>COL 3 - ROW 2<br />text line<br />text line</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>COL 3 - ROW 3</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<th rowspan="3">Left column</th>
|
||||||
|
<th colspan="5">Heading Column Span 5</th>
|
||||||
|
<th colspan="9">Heading Column Span 9</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">Rowspan 2<br />This is some text that fills the table cell.</th>
|
||||||
|
<th colspan="2">span 2</th>
|
||||||
|
<th colspan="2">span 2</th>
|
||||||
|
<th rowspan="2">2 rows</th>
|
||||||
|
<th colspan="8">Colspan 8</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>1a</th>
|
||||||
|
<th>2a</th>
|
||||||
|
<th>1b</th>
|
||||||
|
<th>2b</th>
|
||||||
|
<th>1</th>
|
||||||
|
<th>2</th>
|
||||||
|
<th>3</th>
|
||||||
|
<th>4</th>
|
||||||
|
<th>5</th>
|
||||||
|
<th>6</th>
|
||||||
|
<th>7</th>
|
||||||
|
<th>8</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Table with rowspans and THEAD
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table border="1" cellpadding="2" cellspacing="2">
|
||||||
|
<thead>
|
||||||
|
<tr style="background-color:#FFFF00;color:#0000FF;">
|
||||||
|
<td width="30" align="center"><b>A</b></td>
|
||||||
|
<td width="140" align="center"><b>XXXX</b></td>
|
||||||
|
<td width="140" align="center"><b>XXXX</b></td>
|
||||||
|
<td width="80" align="center"> <b>XXXX</b></td>
|
||||||
|
<td width="80" align="center"><b>XXXX</b></td>
|
||||||
|
<td width="45" align="center"><b>XXXX</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr style="background-color:#FF0000;color:#FFFF00;">
|
||||||
|
<td width="30" align="center"><b>B</b></td>
|
||||||
|
<td width="140" align="center"><b>XXXX</b></td>
|
||||||
|
<td width="140" align="center"><b>XXXX</b></td>
|
||||||
|
<td width="80" align="center"> <b>XXXX</b></td>
|
||||||
|
<td width="80" align="center"><b>XXXX</b></td>
|
||||||
|
<td width="45" align="center"><b>XXXX</b></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tr>
|
||||||
|
<td width="30" align="center">1.</td>
|
||||||
|
<td width="140" rowspan="6">XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX</td>
|
||||||
|
<td width="140">XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX</td>
|
||||||
|
<td align="center" width="45">XXXX<br />XXXX</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="30" align="center" rowspan="3">2.</td>
|
||||||
|
<td width="140" rowspan="3">XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td align="center" width="45">XXXX<br />XXXX</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="80">XXXX<br />XXXX<br />XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td align="center" width="45">XXXX<br />XXXX</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="80" rowspan="2" >RRRRRR<br />XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td align="center" width="45">XXXX<br />XXXX</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="30" align="center">3.</td>
|
||||||
|
<td width="140">XXXX1<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td align="center" width="45">XXXX<br />XXXX</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="30" align="center">4.</td>
|
||||||
|
<td width="140">XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td width="80">XXXX<br />XXXX</td>
|
||||||
|
<td align="center" width="45">XXXX<br />XXXX</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// NON-BREAKING TABLE (nobr="true")
|
||||||
|
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table border="1" cellpadding="2" cellspacing="2" nobr="true">
|
||||||
|
<tr>
|
||||||
|
<th colspan="3" align="center">NON-BREAKING TABLE</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1-1</td>
|
||||||
|
<td>1-2</td>
|
||||||
|
<td>1-3</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>2-1</td>
|
||||||
|
<td>3-2</td>
|
||||||
|
<td>3-3</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>3-1</td>
|
||||||
|
<td>3-2</td>
|
||||||
|
<td>3-3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// NON-BREAKING ROWS (nobr="true")
|
||||||
|
|
||||||
|
$tbl = <<<EOD
|
||||||
|
<table border="1" cellpadding="2" cellspacing="2" align="center">
|
||||||
|
<tr nobr="true">
|
||||||
|
<th colspan="3">NON-BREAKING ROWS</th>
|
||||||
|
</tr>
|
||||||
|
<tr nobr="true">
|
||||||
|
<td>ROW 1<br />COLUMN 1</td>
|
||||||
|
<td>ROW 1<br />COLUMN 2</td>
|
||||||
|
<td>ROW 1<br />COLUMN 3</td>
|
||||||
|
</tr>
|
||||||
|
<tr nobr="true">
|
||||||
|
<td>ROW 2<br />COLUMN 1</td>
|
||||||
|
<td>ROW 2<br />COLUMN 2</td>
|
||||||
|
<td>ROW 2<br />COLUMN 3</td>
|
||||||
|
</tr>
|
||||||
|
<tr nobr="true">
|
||||||
|
<td>ROW 3<br />COLUMN 1</td>
|
||||||
|
<td>ROW 3<br />COLUMN 2</td>
|
||||||
|
<td>ROW 3<br />COLUMN 3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
$pdf->writeHTML($tbl, true, false, false, false, '');
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_048.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
126
TCPDF/examples/example_049.php
Normal file
126
TCPDF/examples/example_049.php
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_049.php
|
||||||
|
// Begin : 2009-04-03
|
||||||
|
// Last Update : 2014-12-10
|
||||||
|
//
|
||||||
|
// Description : Example 049 for TCPDF class
|
||||||
|
// WriteHTML with TCPDF callback functions
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: WriteHTML with TCPDF callback functions
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 049');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 049', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
|
||||||
|
IMPORTANT:
|
||||||
|
If you are printing user-generated content, tcpdf tag can be unsafe.
|
||||||
|
You can disable this tag by setting to false the K_TCPDF_CALLS_IN_HTML
|
||||||
|
constant on TCPDF configuration file.
|
||||||
|
|
||||||
|
For security reasons, the parameters for the 'params' attribute of TCPDF
|
||||||
|
tag must be prepared as an array and encoded with the
|
||||||
|
serializeTCPDFtagParameters() method (see the example below).
|
||||||
|
|
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
|
||||||
|
$html = '<h1>Test TCPDF Methods in HTML</h1>
|
||||||
|
<h2 style="color:red;">IMPORTANT:</h2>
|
||||||
|
<span style="color:red;">If you are using user-generated content, the tcpdf tag can be unsafe.<br />
|
||||||
|
You can disable this tag by setting to false the <b>K_TCPDF_CALLS_IN_HTML</b> constant on TCPDF configuration file.</span>
|
||||||
|
<h2>write1DBarcode method in HTML</h2>';
|
||||||
|
|
||||||
|
$params = $pdf->serializeTCPDFtagParameters(array('CODE 39', 'C39', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
|
||||||
|
$html .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
|
||||||
|
|
||||||
|
$params = $pdf->serializeTCPDFtagParameters(array('CODE 128', 'C128', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
|
||||||
|
$html .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
|
||||||
|
|
||||||
|
$html .= '<tcpdf method="AddPage" /><h2>Graphic Functions</h2>';
|
||||||
|
|
||||||
|
$params = $pdf->serializeTCPDFtagParameters(array(0));
|
||||||
|
$html .= '<tcpdf method="SetDrawColor" params="'.$params.'" />';
|
||||||
|
|
||||||
|
$params = $pdf->serializeTCPDFtagParameters(array(50, 50, 40, 10, 'DF', array(), array(0,128,255)));
|
||||||
|
$html .= '<tcpdf method="Rect" params="'.$params.'" />';
|
||||||
|
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, 0, true, 0);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_049.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
210
TCPDF/examples/example_050.php
Normal file
210
TCPDF/examples/example_050.php
Normal file
|
@ -0,0 +1,210 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_050.php
|
||||||
|
// Begin : 2009-04-09
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 050 for TCPDF class
|
||||||
|
// 2D Barcodes
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: 2D barcodes.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 050');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 050', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// NOTE: 2D barcode algorithms must be implemented on 2dbarcode.php class file.
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 11);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a message
|
||||||
|
$txt = "You can also export 2D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcode directory.\n";
|
||||||
|
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// set style for barcode
|
||||||
|
$style = array(
|
||||||
|
'border' => true,
|
||||||
|
'vpadding' => 'auto',
|
||||||
|
'hpadding' => 'auto',
|
||||||
|
'fgcolor' => array(0,0,0),
|
||||||
|
'bgcolor' => false, //array(255,255,255)
|
||||||
|
'module_width' => 1, // width of a single module in points
|
||||||
|
'module_height' => 1 // height of a single module in points
|
||||||
|
);
|
||||||
|
|
||||||
|
// write RAW 2D Barcode
|
||||||
|
|
||||||
|
$code = '111011101110111,010010001000010,010011001110010,010010000010010,010011101110010';
|
||||||
|
$pdf->write2DBarcode($code, 'RAW', 80, 30, 30, 20, $style, 'N');
|
||||||
|
|
||||||
|
// write RAW2 2D Barcode
|
||||||
|
$code = '[111011101110111][010010001000010][010011001110010][010010000010010][010011101110010]';
|
||||||
|
$pdf->write2DBarcode($code, 'RAW2', 80, 60, 30, 20, $style, 'N');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// set style for barcode
|
||||||
|
$style = array(
|
||||||
|
'border' => 2,
|
||||||
|
'vpadding' => 'auto',
|
||||||
|
'hpadding' => 'auto',
|
||||||
|
'fgcolor' => array(0,0,0),
|
||||||
|
'bgcolor' => false, //array(255,255,255)
|
||||||
|
'module_width' => 1, // width of a single module in points
|
||||||
|
'module_height' => 1 // height of a single module in points
|
||||||
|
);
|
||||||
|
|
||||||
|
// QRCODE,L : QR-CODE Low error correction
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,L', 20, 30, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(20, 25, 'QRCODE L');
|
||||||
|
|
||||||
|
// QRCODE,M : QR-CODE Medium error correction
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,M', 20, 90, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(20, 85, 'QRCODE M');
|
||||||
|
|
||||||
|
// QRCODE,Q : QR-CODE Better error correction
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,Q', 20, 150, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(20, 145, 'QRCODE Q');
|
||||||
|
|
||||||
|
// QRCODE,H : QR-CODE Best error correction
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 20, 210, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(20, 205, 'QRCODE H');
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// PDF417 (ISO/IEC 15438:2006)
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
The $type parameter can be simple 'PDF417' or 'PDF417' followed by a
|
||||||
|
number of comma-separated options:
|
||||||
|
|
||||||
|
'PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6'
|
||||||
|
|
||||||
|
Possible options are:
|
||||||
|
|
||||||
|
a = aspect ratio (width/height);
|
||||||
|
e = error correction level (0-8);
|
||||||
|
|
||||||
|
Macro Control Block options:
|
||||||
|
|
||||||
|
t = total number of macro segments;
|
||||||
|
s = macro segment index (0-99998);
|
||||||
|
f = file ID;
|
||||||
|
o0 = File Name (text);
|
||||||
|
o1 = Segment Count (numeric);
|
||||||
|
o2 = Time Stamp (numeric);
|
||||||
|
o3 = Sender (text);
|
||||||
|
o4 = Addressee (text);
|
||||||
|
o5 = File Size (numeric);
|
||||||
|
o6 = Checksum (numeric).
|
||||||
|
|
||||||
|
Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional.
|
||||||
|
To use a comma character ',' on text options, replace it with the character 255: "\xff".
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'PDF417', 80, 90, 0, 30, $style, 'N');
|
||||||
|
$pdf->Text(80, 85, 'PDF417 (ISO/IEC 15438:2006)');
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// DATAMATRIX (ISO/IEC 16022:2006)
|
||||||
|
|
||||||
|
$pdf->write2DBarcode('http://www.tcpdf.org', 'DATAMATRIX', 80, 150, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(80, 145, 'DATAMATRIX (ISO/IEC 16022:2006)');
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
|
||||||
|
// new style
|
||||||
|
$style = array(
|
||||||
|
'border' => 2,
|
||||||
|
'padding' => 'auto',
|
||||||
|
'fgcolor' => array(0,0,255),
|
||||||
|
'bgcolor' => array(255,255,64)
|
||||||
|
);
|
||||||
|
|
||||||
|
// QRCODE,H : QR-CODE Best error correction
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 80, 210, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(80, 205, 'QRCODE H - COLORED');
|
||||||
|
|
||||||
|
// new style
|
||||||
|
$style = array(
|
||||||
|
'border' => false,
|
||||||
|
'padding' => 0,
|
||||||
|
'fgcolor' => array(128,0,0),
|
||||||
|
'bgcolor' => false
|
||||||
|
);
|
||||||
|
|
||||||
|
// QRCODE,H : QR-CODE Best error correction
|
||||||
|
$pdf->write2DBarcode('www.tcpdf.org', 'QRCODE,H', 140, 210, 50, 50, $style, 'N');
|
||||||
|
$pdf->Text(140, 205, 'QRCODE H - NO PADDING');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_050.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
145
TCPDF/examples/example_051.php
Normal file
145
TCPDF/examples/example_051.php
Normal file
|
@ -0,0 +1,145 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_051.php
|
||||||
|
// Begin : 2009-04-16
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 051 for TCPDF class
|
||||||
|
// Full page background
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Full page background
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-04-16
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
|
||||||
|
// Extend the TCPDF class to create custom Header and Footer
|
||||||
|
class MYPDF extends TCPDF {
|
||||||
|
//Page header
|
||||||
|
public function Header() {
|
||||||
|
// get the current page break margin
|
||||||
|
$bMargin = $this->getBreakMargin();
|
||||||
|
// get current auto-page-break mode
|
||||||
|
$auto_page_break = $this->AutoPageBreak;
|
||||||
|
// disable auto-page-break
|
||||||
|
$this->SetAutoPageBreak(false, 0);
|
||||||
|
// set bacground image
|
||||||
|
$img_file = K_PATH_IMAGES.'image_demo.jpg';
|
||||||
|
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
|
||||||
|
// restore auto-page-break status
|
||||||
|
$this->SetAutoPageBreak($auto_page_break, $bMargin);
|
||||||
|
// set the starting point for the page content
|
||||||
|
$this->setPageMark();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 051');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(0);
|
||||||
|
$pdf->SetFooterMargin(0);
|
||||||
|
|
||||||
|
// remove default footer
|
||||||
|
$pdf->setPrintFooter(false);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 48);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// Print a text
|
||||||
|
$html = '<span style="background-color:yellow;color:blue;"> PAGE 1 </span>
|
||||||
|
<p stroke="0.2" fill="true" strokecolor="yellow" color="blue" style="font-family:helvetica;font-weight:bold;font-size:26pt;">You can set a full page background.</p>';
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// Print a text
|
||||||
|
$html = '<span style="background-color:yellow;color:blue;"> PAGE 2 </span>';
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// --- example with background set on page ---
|
||||||
|
|
||||||
|
// remove default header
|
||||||
|
$pdf->setPrintHeader(false);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
|
||||||
|
// -- set new background ---
|
||||||
|
|
||||||
|
// get the current page break margin
|
||||||
|
$bMargin = $pdf->getBreakMargin();
|
||||||
|
// get current auto-page-break mode
|
||||||
|
$auto_page_break = $pdf->getAutoPageBreak();
|
||||||
|
// disable auto-page-break
|
||||||
|
$pdf->SetAutoPageBreak(false, 0);
|
||||||
|
// set bacground image
|
||||||
|
$img_file = K_PATH_IMAGES.'image_demo.jpg';
|
||||||
|
$pdf->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
|
||||||
|
// restore auto-page-break status
|
||||||
|
$pdf->SetAutoPageBreak($auto_page_break, $bMargin);
|
||||||
|
// set the starting point for the page content
|
||||||
|
$pdf->setPageMark();
|
||||||
|
|
||||||
|
|
||||||
|
// Print a text
|
||||||
|
$html = '<span style="color:white;text-align:center;font-weight:bold;font-size:80pt;">PAGE 3</span>';
|
||||||
|
$pdf->writeHTML($html, true, false, true, false, '');
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_051.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
121
TCPDF/examples/example_052.php
Normal file
121
TCPDF/examples/example_052.php
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_052.php
|
||||||
|
// Begin : 2009-05-07
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 052 for TCPDF class
|
||||||
|
// Certification Signature (experimental)
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Certification Signature (experimental)
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-05-07
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 052');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 052', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
/*
|
||||||
|
NOTES:
|
||||||
|
- To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
|
||||||
|
- To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
|
||||||
|
- To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes
|
||||||
|
*/
|
||||||
|
|
||||||
|
// set certificate file
|
||||||
|
$certificate = 'file://data/cert/tcpdf.crt';
|
||||||
|
|
||||||
|
// set additional information
|
||||||
|
$info = array(
|
||||||
|
'Name' => 'TCPDF',
|
||||||
|
'Location' => 'Office',
|
||||||
|
'Reason' => 'Testing TCPDF',
|
||||||
|
'ContactInfo' => 'http://www.tcpdf.org',
|
||||||
|
);
|
||||||
|
|
||||||
|
// set document signature
|
||||||
|
$pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 12);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a line of text
|
||||||
|
$text = 'This is a <b color="#FF0000">digitally signed document</b> using the default (example) <b>tcpdf.crt</b> certificate.<br />To validate this signature you have to load the <b color="#006600">tcpdf.fdf</b> on the Arobat Reader to add the certificate to <i>List of Trusted Identities</i>.<br /><br />For more information check the source code of this example and the source code documentation for the <i>setSignature()</i> method.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>';
|
||||||
|
$pdf->writeHTML($text, true, 0, true, 0);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// *** set signature appearance ***
|
||||||
|
|
||||||
|
// create content for signature (image and/or text)
|
||||||
|
$pdf->Image('images/tcpdf_signature.png', 180, 60, 15, 15, 'PNG');
|
||||||
|
|
||||||
|
// define active area for signature appearance
|
||||||
|
$pdf->setSignatureAppearance(180, 60, 15, 15);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// *** set an empty signature appearance ***
|
||||||
|
$pdf->addEmptySignatureAppearance(180, 80, 15, 15);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_052.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
108
TCPDF/examples/example_053.php
Normal file
108
TCPDF/examples/example_053.php
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_053.php
|
||||||
|
// Begin : 2009-09-02
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 053 for TCPDF class
|
||||||
|
// Javascript example.
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Javascript example.
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-09-02
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 053');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 053', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('times', '', 14);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// print a some of text
|
||||||
|
$text = 'This is an example of <strong>JavaScript</strong> usage on PDF documents.<br /><br />For more information check the source code of this example, the source code documentation for the <i>IncludeJS()</i> method and the <i>JavaScript for Acrobat API Reference</i> guide.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>';
|
||||||
|
$pdf->writeHTML($text, true, 0, true, 0);
|
||||||
|
|
||||||
|
// write some JavaScript code
|
||||||
|
$js = <<<EOD
|
||||||
|
app.alert('JavaScript Popup Example', 3, 0, 'Welcome');
|
||||||
|
var cResponse = app.response({
|
||||||
|
cQuestion: 'How are you today?',
|
||||||
|
cTitle: 'Your Health Status',
|
||||||
|
cDefault: 'Fine',
|
||||||
|
cLabel: 'Response:'
|
||||||
|
});
|
||||||
|
if (cResponse == null) {
|
||||||
|
app.alert('Thanks for trying anyway.', 3, 0, 'Result');
|
||||||
|
} else {
|
||||||
|
app.alert('You responded, "'+cResponse+'", to the health question.', 3, 0, 'Result');
|
||||||
|
}
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// force print dialog
|
||||||
|
$js .= 'print(true);';
|
||||||
|
|
||||||
|
// set javascript
|
||||||
|
$pdf->IncludeJS($js);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_053.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
128
TCPDF/examples/example_054.php
Normal file
128
TCPDF/examples/example_054.php
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_054.php
|
||||||
|
// Begin : 2009-09-07
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 054 for TCPDF class
|
||||||
|
// XHTML Forms
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: XHTML Forms
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-09-07
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 054');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 054', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// IMPORTANT: disable font subsetting to allow users editing the document
|
||||||
|
$pdf->setFontSubsetting(false);
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 10, '', false);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// create some HTML content
|
||||||
|
$html = <<<EOD
|
||||||
|
<h1>XHTML Form Example</h1>
|
||||||
|
<form method="post" action="http://localhost/printvars.php" enctype="multipart/form-data">
|
||||||
|
<label for="name">name:</label> <input type="text" name="name" value="" size="20" maxlength="30" /><br />
|
||||||
|
<label for="password">password:</label> <input type="password" name="password" value="" size="20" maxlength="30" /><br /><br />
|
||||||
|
<label for="infile">file:</label> <input type="file" name="userfile" size="20" /><br /><br />
|
||||||
|
<input type="checkbox" name="agree" value="1" checked="checked" /> <label for="agree">I agree </label><br /><br />
|
||||||
|
<input type="radio" name="radioquestion" id="rqa" value="1" /> <label for="rqa">one</label><br />
|
||||||
|
<input type="radio" name="radioquestion" id="rqb" value="2" checked="checked"/> <label for="rqb">two</label><br />
|
||||||
|
<input type="radio" name="radioquestion" id="rqc" value="3" /> <label for="rqc">three</label><br /><br />
|
||||||
|
<label for="selection">select:</label>
|
||||||
|
<select name="selection" size="0">
|
||||||
|
<option value="0">zero</option>
|
||||||
|
<option value="1">one</option>
|
||||||
|
<option value="2">two</option>
|
||||||
|
<option value="3">three</option>
|
||||||
|
</select><br /><br />
|
||||||
|
<label for="selection">select:</label>
|
||||||
|
<select name="multiselection" size="2" multiple="multiple">
|
||||||
|
<option value="0">zero</option>
|
||||||
|
<option value="1">one</option>
|
||||||
|
<option value="2">two</option>
|
||||||
|
<option value="3">three</option>
|
||||||
|
</select><br /><br /><br />
|
||||||
|
<label for="text">text area:</label><br />
|
||||||
|
<textarea cols="40" rows="3" name="text">line one
|
||||||
|
line two</textarea><br />
|
||||||
|
<br /><br /><br />
|
||||||
|
<input type="reset" name="reset" value="Reset" />
|
||||||
|
<input type="submit" name="submit" value="Submit" />
|
||||||
|
<input type="button" name="print" value="Print" onclick="print()" />
|
||||||
|
<input type="hidden" name="hiddenfield" value="OK" />
|
||||||
|
<br />
|
||||||
|
</form>
|
||||||
|
EOD;
|
||||||
|
|
||||||
|
// output the HTML content
|
||||||
|
$pdf->writeHTML($html, true, 0, true, 0);
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_054.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
115
TCPDF/examples/example_055.php
Normal file
115
TCPDF/examples/example_055.php
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_055.php
|
||||||
|
// Begin : 2009-10-21
|
||||||
|
// Last Update : 2014-12-10
|
||||||
|
//
|
||||||
|
// Description : Example 055 for TCPDF class
|
||||||
|
// Display all characters available on core fonts.
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display all characters available on core fonts.
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: XHTML Forms
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2009-10-21
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 055');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 055', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 14);
|
||||||
|
|
||||||
|
// array of font names
|
||||||
|
$core_fonts = array('courier', 'courierB', 'courierI', 'courierBI', 'helvetica', 'helveticaB', 'helveticaI', 'helveticaBI', 'times', 'timesB', 'timesI', 'timesBI', 'symbol', 'zapfdingbats');
|
||||||
|
|
||||||
|
// set fill color
|
||||||
|
$pdf->SetFillColor(221,238,255);
|
||||||
|
|
||||||
|
// create one HTML table for each core font
|
||||||
|
foreach($core_fonts as $font) {
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
|
||||||
|
|
||||||
|
// set font for title
|
||||||
|
$pdf->SetFont('helvetica', 'B', 16);
|
||||||
|
|
||||||
|
// print font name
|
||||||
|
$pdf->Cell(0, 10, 'FONT: '.$font, 1, 1, 'C', true, '', 0, false, 'T', 'M');
|
||||||
|
|
||||||
|
// set font for chars
|
||||||
|
$pdf->SetFont($font, '', 16);
|
||||||
|
|
||||||
|
// print each character
|
||||||
|
for ($i = 0; $i < 256; ++$i) {
|
||||||
|
if (($i > 0) AND (($i % 16) == 0)) {
|
||||||
|
$pdf->Ln();
|
||||||
|
}
|
||||||
|
$pdf->Cell(11.25, 11.25, TCPDF_FONTS::unichr($i), 1, 0, 'C', false, '', 0, false, 'T', 'M');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->Ln(20);
|
||||||
|
|
||||||
|
// print a pangram
|
||||||
|
$pdf->Cell(0, 0, 'The quick brown fox jumps over the lazy dog', 0, 1, 'C', false, '', 0, false, 'T', 'M');
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_055.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
133
TCPDF/examples/example_056.php
Normal file
133
TCPDF/examples/example_056.php
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_056.php
|
||||||
|
// Begin : 2010-03-26
|
||||||
|
// Last Update : 2013-09-30
|
||||||
|
//
|
||||||
|
// Description : Example 056 for TCPDF class
|
||||||
|
// Crop marks and color registration bars
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Crop marks and color registration bars
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2010-03-26
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 056');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 056', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 18);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of Registration Marks, Crop Marks and Color Bars', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
// color registration bars
|
||||||
|
|
||||||
|
// A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,<SPOT_COLOR_NAME>
|
||||||
|
$pdf->colorRegistrationBar(50, 70, 40, 40, true, false, 'A,R,G,B,C,M,Y,K');
|
||||||
|
$pdf->colorRegistrationBar(90, 70, 40, 40, true, true, 'A,R,G,B,C,M,Y,K');
|
||||||
|
$pdf->colorRegistrationBar(50, 115, 80, 5, false, true, 'A,W,R,G,B,C,M,Y,K,ALL');
|
||||||
|
$pdf->colorRegistrationBar(135, 70, 5, 50, false, false, 'A,W,R,G,B,C,M,Y,K,ALL');
|
||||||
|
|
||||||
|
// corner crop marks
|
||||||
|
|
||||||
|
$pdf->cropMark(50, 70, 10, 10, 'TL');
|
||||||
|
$pdf->cropMark(140, 70, 10, 10, 'TR');
|
||||||
|
$pdf->cropMark(50, 120, 10, 10, 'BL');
|
||||||
|
$pdf->cropMark(140, 120, 10, 10, 'BR');
|
||||||
|
|
||||||
|
// various crop marks
|
||||||
|
|
||||||
|
$pdf->cropMark(95, 65, 5, 5, 'LEFT,TOP,RIGHT', array(255,0,0));
|
||||||
|
$pdf->cropMark(95, 125, 5, 5, 'LEFT,BOTTOM,RIGHT', array(255,0,0));
|
||||||
|
|
||||||
|
$pdf->cropMark(45, 95, 5, 5, 'TL,BL', array(0,255,0));
|
||||||
|
$pdf->cropMark(145, 95, 5, 5, 'TR,BR', array(0,255,0));
|
||||||
|
|
||||||
|
$pdf->cropMark(95, 140, 5, 5, 'A,D', array(0,0,255));
|
||||||
|
|
||||||
|
// registration marks
|
||||||
|
|
||||||
|
$pdf->registrationMark(40, 60, 5, false);
|
||||||
|
$pdf->registrationMark(150, 60, 5, true, array(0,0,0), array(255,255,0));
|
||||||
|
$pdf->registrationMark(40, 130, 5, true, array(0,0,0), array(255,255,0));
|
||||||
|
$pdf->registrationMark(150, 130, 5, false, array(100,100,100,100,'All'), array(0,0,0,0,'None'));
|
||||||
|
|
||||||
|
// test registration bar with spot colors
|
||||||
|
|
||||||
|
$pdf->AddSpotColor('My TCPDF Dark Green', 100, 50, 80, 45);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Light Yellow', 0, 0, 55, 0);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Black', 0, 0, 0, 100);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Red', 30, 100, 90, 10);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Green', 100, 30, 100, 0);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Blue', 100, 60, 10, 5);
|
||||||
|
$pdf->AddSpotColor('My TCPDF Yellow', 0, 20, 100, 0);
|
||||||
|
|
||||||
|
$pdf->colorRegistrationBar(50, 150, 80, 10, false, true, 'ALLSPOT');
|
||||||
|
|
||||||
|
// CMYK registration mark
|
||||||
|
$pdf->registrationMarkCMYK(150, 155, 8);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_056.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
268
TCPDF/examples/example_057.php
Normal file
268
TCPDF/examples/example_057.php
Normal file
|
@ -0,0 +1,268 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_057.php
|
||||||
|
// Begin : 2010-04-03
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 057 for TCPDF class
|
||||||
|
// Cell vertical alignments
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: Cell vertical alignments
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2008-03-04
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 057');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 057', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of alignment options for Cell()', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 11);
|
||||||
|
|
||||||
|
// set border width
|
||||||
|
$pdf->SetLineWidth(0.7);
|
||||||
|
|
||||||
|
// set color for cell border
|
||||||
|
$pdf->SetDrawColor(0,128,255);
|
||||||
|
|
||||||
|
$pdf->setCellHeightRatio(3);
|
||||||
|
|
||||||
|
$pdf->SetXY(15, 60);
|
||||||
|
|
||||||
|
// text on center
|
||||||
|
$pdf->Cell(30, 0, 'Top-Center', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Cell(30, 0, 'Center-Center', 1, $ln=0, 'C', 0, '', 0, false, 'C', 'C');
|
||||||
|
$pdf->Cell(30, 0, 'Bottom-Center', 1, $ln=0, 'C', 0, '', 0, false, 'B', 'C');
|
||||||
|
$pdf->Cell(30, 0, 'Ascent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'C');
|
||||||
|
$pdf->Cell(30, 0, 'Baseline-Center', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'C');
|
||||||
|
$pdf->Cell(30, 0, 'Descent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'C');
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->SetXY(15, 90);
|
||||||
|
|
||||||
|
// text on top
|
||||||
|
$pdf->Cell(30, 0, 'Top-Top', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'T');
|
||||||
|
$pdf->Cell(30, 0, 'Center-Top', 1, $ln=0, 'C', 0, '', 0, false, 'C', 'T');
|
||||||
|
$pdf->Cell(30, 0, 'Bottom-Top', 1, $ln=0, 'C', 0, '', 0, false, 'B', 'T');
|
||||||
|
$pdf->Cell(30, 0, 'Ascent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'T');
|
||||||
|
$pdf->Cell(30, 0, 'Baseline-Top', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'T');
|
||||||
|
$pdf->Cell(30, 0, 'Descent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'T');
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->SetXY(15, 120);
|
||||||
|
|
||||||
|
// text on bottom
|
||||||
|
$pdf->Cell(30, 0, 'Top-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'B');
|
||||||
|
$pdf->Cell(30, 0, 'Center-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'C', 'B');
|
||||||
|
$pdf->Cell(30, 0, 'Bottom-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'B', 'B');
|
||||||
|
$pdf->Cell(30, 0, 'Ascent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'A', 'B');
|
||||||
|
$pdf->Cell(30, 0, 'Baseline-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'B');
|
||||||
|
$pdf->Cell(30, 0, 'Descent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'B');
|
||||||
|
|
||||||
|
|
||||||
|
// draw some reference lines
|
||||||
|
$linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0));
|
||||||
|
$pdf->Line(15, 60, 195, 60, $linestyle);
|
||||||
|
$pdf->Line(15, 90, 195, 90, $linestyle);
|
||||||
|
$pdf->Line(15, 120, 195, 120, $linestyle);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// Print an image to explain cell measures
|
||||||
|
|
||||||
|
$pdf->Image('images/tcpdf_cell.png', 15, 160, 100, 100, 'PNG', '', '', false, 300, '', false, false, 0, false, false, false);
|
||||||
|
$legend = 'LEGEND:
|
||||||
|
|
||||||
|
X: cell x top-left origin (top-right for RTL)
|
||||||
|
Y: cell y top-left origin (top-right for RTL)
|
||||||
|
CW: cell width
|
||||||
|
CH: cell height
|
||||||
|
LW: line width
|
||||||
|
NRL: normal line position
|
||||||
|
EXT: external line position
|
||||||
|
INT: internal line position
|
||||||
|
ML: margin left
|
||||||
|
MR: margin right
|
||||||
|
MT: margin top
|
||||||
|
MB: margin bottom
|
||||||
|
PL: padding left
|
||||||
|
PR: padding right
|
||||||
|
PT: padding top
|
||||||
|
PB: padding bottom
|
||||||
|
TW: text width
|
||||||
|
FA: font ascent
|
||||||
|
FB: font baseline
|
||||||
|
FD: font descent';
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
$pdf->setCellHeightRatio(1.25);
|
||||||
|
$pdf->MultiCell(0, 0, $legend, 0, 'L', false, 1, 125, 160, true, 0, false, true, 0, 'T', false);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// CELL BORDERS
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of borders for Cell()', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 11);
|
||||||
|
|
||||||
|
// set border width
|
||||||
|
$pdf->SetLineWidth(0.508);
|
||||||
|
|
||||||
|
// set color for cell border
|
||||||
|
$pdf->SetDrawColor(0,128,255);
|
||||||
|
|
||||||
|
// set filling color
|
||||||
|
$pdf->SetFillColor(255,255,128);
|
||||||
|
|
||||||
|
// set cell height ratio
|
||||||
|
$pdf->setCellHeightRatio(3);
|
||||||
|
|
||||||
|
$pdf->Cell(30, 0, '1', 1, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LTRB', 'LTRB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LTR', 'LTR', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'TRB', 'TRB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LRB', 'LRB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LTB', 'LTB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LT', 'LT', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'TR', 'TR', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'RB', 'RB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LB', 'LB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'LR', 'LR', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'TB', 'TB', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'L', 'L', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'T', 'T', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'R', 'R', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(2);
|
||||||
|
$pdf->Cell(30, 0, 'B', 'B', 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// ADVANCED SETTINGS FOR CELL BORDERS
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', 'B', 20);
|
||||||
|
|
||||||
|
$pdf->Write(0, 'Example of advanced border settings for Cell()', '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 11);
|
||||||
|
|
||||||
|
// set border width
|
||||||
|
$pdf->SetLineWidth(1);
|
||||||
|
|
||||||
|
// set color for cell border
|
||||||
|
$pdf->SetDrawColor(0,128,255);
|
||||||
|
|
||||||
|
// set filling color
|
||||||
|
$pdf->SetFillColor(255,255,128);
|
||||||
|
|
||||||
|
$border = array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||||
|
$pdf->Cell(30, 0, 'LTRB', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$border = array(
|
||||||
|
'L' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)),
|
||||||
|
'R' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 255)),
|
||||||
|
'T' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 255, 0)),
|
||||||
|
'B' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 255)));
|
||||||
|
$pdf->Cell(30, 0, 'LTRB', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$border = array('mode' => 'ext', 'LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||||
|
$pdf->Cell(30, 0, 'LTRB EXT', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
$border = array('mode' => 'int', 'LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
|
||||||
|
$pdf->Cell(30, 0, 'LTRB INT', $border, 1, 'C', 1, '', 0, false, 'T', 'C');
|
||||||
|
$pdf->Ln(5);
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
// reset pointer to the last page
|
||||||
|
$pdf->lastPage();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_057.pdf', 'I');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
94
TCPDF/examples/example_058.php
Normal file
94
TCPDF/examples/example_058.php
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
<?php
|
||||||
|
//============================================================+
|
||||||
|
// File name : example_058.php
|
||||||
|
// Begin : 2010-04-22
|
||||||
|
// Last Update : 2013-05-14
|
||||||
|
//
|
||||||
|
// Description : Example 058 for TCPDF class
|
||||||
|
// SVG Image
|
||||||
|
//
|
||||||
|
// Author: Nicola Asuni
|
||||||
|
//
|
||||||
|
// (c) Copyright:
|
||||||
|
// Nicola Asuni
|
||||||
|
// Tecnick.com LTD
|
||||||
|
// www.tecnick.com
|
||||||
|
// info@tecnick.com
|
||||||
|
//============================================================+
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an example PDF TEST document using TCPDF
|
||||||
|
* @package com.tecnick.tcpdf
|
||||||
|
* @abstract TCPDF - Example: SVG Image
|
||||||
|
* @author Nicola Asuni
|
||||||
|
* @since 2010-05-02
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Include the main TCPDF library (search for installation path).
|
||||||
|
require_once('tcpdf_include.php');
|
||||||
|
|
||||||
|
// create new PDF document
|
||||||
|
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||||
|
|
||||||
|
// set document information
|
||||||
|
$pdf->SetCreator(PDF_CREATOR);
|
||||||
|
$pdf->SetAuthor('Nicola Asuni');
|
||||||
|
$pdf->SetTitle('TCPDF Example 058');
|
||||||
|
$pdf->SetSubject('TCPDF Tutorial');
|
||||||
|
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
|
||||||
|
|
||||||
|
// set default header data
|
||||||
|
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 058', PDF_HEADER_STRING);
|
||||||
|
|
||||||
|
// set header and footer fonts
|
||||||
|
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||||
|
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||||
|
|
||||||
|
// set default monospaced font
|
||||||
|
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||||
|
|
||||||
|
// set margins
|
||||||
|
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||||
|
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||||
|
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||||
|
|
||||||
|
// set auto page breaks
|
||||||
|
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||||
|
|
||||||
|
// set image scale factor
|
||||||
|
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||||
|
|
||||||
|
// set some language-dependent strings (optional)
|
||||||
|
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
||||||
|
require_once(dirname(__FILE__).'/lang/eng.php');
|
||||||
|
$pdf->setLanguageArray($l);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
// set font
|
||||||
|
$pdf->SetFont('helvetica', '', 10);
|
||||||
|
|
||||||
|
// add a page
|
||||||
|
$pdf->AddPage();
|
||||||
|
|
||||||
|
// NOTE: Uncomment the following line to rasterize SVG image using the ImageMagick library.
|
||||||
|
//$pdf->setRasterizeVectorImages(true);
|
||||||
|
|
||||||
|
$pdf->ImageSVG($file='images/testsvg.svg', $x=15, $y=30, $w='', $h='', $link='http://www.tcpdf.org', $align='', $palign='', $border=1, $fitonpage=false);
|
||||||
|
|
||||||
|
$pdf->ImageSVG($file='images/tux.svg', $x=30, $y=100, $w='', $h=100, $link='', $align='', $palign='', $border=0, $fitonpage=false);
|
||||||
|
|
||||||
|
$pdf->SetFont('helvetica', '', 8);
|
||||||
|
$pdf->SetY(195);
|
||||||
|
$txt = '© The copyright holder of the above Tux image is Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.';
|
||||||
|
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
|
||||||
|
//Close and output PDF document
|
||||||
|
$pdf->Output('example_058.pdf', 'D');
|
||||||
|
|
||||||
|
//============================================================+
|
||||||
|
// END OF FILE
|
||||||
|
//============================================================+
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue