Skip to content

Instantly share code, notes, and snippets.

View datalogics-pgallot's full-sized avatar

Patrick Gallot datalogics-pgallot

  • Datalogics, Inc.
  • Chicago, IL
View GitHub Profile
@datalogics-pgallot
datalogics-pgallot / wernerColors.py
Created January 3, 2019 14:58
Convert Rougeux's data on Werner's nomenclature of colours into a PDF with CMYK colours.
import clr
import math, re, copy
import sys,os.path, shutil
from System.Collections.Generic import List
clr.AddReferenceToFile("Datalogics.PDFL.dll")
from Datalogics import PDFL
def read_tsv(filename, header=True):
"""reads a TSV file with a header row; will return an empty columns array if no header row."""
@datalogics-pgallot
datalogics-pgallot / Layout.py
Created December 1, 2015 21:11
IronPython code using APDFL/DLE to generate basic Presentation PDFs
import clr
import getopt, sys, os, os.path, fnmatch, string, stat,re, shutil, math
controlfile="C:\\projects\\pillowbook\\controlfile.txt"
outputfile= "C:\\projects\\pillowbook\\controlfile.pdf"
clr.AddReferenceToFile("Datalogics.PDFL.dll")
from Datalogics import PDFL
def shrinkToFitText(text, rect, overflow, font, ts, gs, debug=False):
@datalogics-pgallot
datalogics-pgallot / presentation.txt
Created December 1, 2015 21:07
PDF Color Presentation control file
metadata -author "Patrick Gallot" -title "An Overview of PDF Color beyond the PDF Reference"
font -name "Berlin Sans FB" -default
pageimport "C:\projects\ColorPresentation\input\testPatterns.pdf" -page 20 -label "Presentation outline" -rect (0,0,792,612)
inline "Presentation Outline" -rect (108,444,684,576) -fontsize 30 -textjustify center -underline -valign top -color (0.65)
listicle "C:\projects\ColorPresentation\notes\OutlinePoints.txt" -rect (72,36,756, 444) -fontsize 24 -color (0.75) -bulletFont "Arial Unicode" -bullet 0x2712 -bulletcolor (0.65)
transition Box -outward -duration 500
pageimport "C:\projects\ColorPresentation\input\testPatterns.pdf" -page 22 -label "Joseph Albers Quotation" -rect (0,0,792,612)
@datalogics-pgallot
datalogics-pgallot / DocFontList.cpp
Created July 10, 2015 18:51
Sample app which reproduces Acrobat's Document Properties Fonts tab listing.
/*
// Project: DocFontList - Sample app which reproduces Acrobat's Document Properties Fonts tab listing.
// However, it does not sort the fonts into alphabetical order, and it does not
// list substitute fonts (aka Actual Fonts)
*/
#ifndef MAC_ENV
#include <sys/types.h>
#include <sys/stat.h>
#endif