Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Gallot datalogics-pgallot

  • Datalogics, Inc.
  • Chicago, IL
View GitHub Profile
@datalogics-pgallot
datalogics-pgallot / wernerColors.py
Created Jan 3, 2019
Convert Rougeux's data on Werner's nomenclature of colours into a PDF with CMYK colours.
View wernerColors.py
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 Dec 1, 2015
IronPython code using APDFL/DLE to generate basic Presentation PDFs
View Layout.py
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 Dec 1, 2015
PDF Color Presentation control file
View presentation.txt
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 Jul 10, 2015
Sample app which reproduces Acrobat's Document Properties Fonts tab listing.
View DocFontList.cpp
/*
// 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