Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working on PDF accessibility

Patrick Gundlach pgundlach

💭
Working on PDF accessibility
View GitHub Profile
@pgundlach
pgundlach / data.xml
Last active Sep 7, 2020
Example for table construction
View data.xml
<data>
<entry>E3Q7wpaCuqlEW7IpD5wLZ%EKnL6l6KzJ</entry>
<entry>0wLL7=Y6XKUDw$rS3STaxq6vGnPC,S,s</entry>
<entry>uIB9xFJ7o1c9cpvdW-fuAn8%7V6XjsP5</entry>
<entry>ApBxPOQAeqn1vLBDZgUhsMCa:yoEw3-O</entry>
<entry>XMa0V%Cgp09GLHlGNiby8,2zwHgPqs.r</entry>
<entry>5A;ybcJtNQ.k58Vium=PFdShVJ5X1pg4</entry>
<entry>XFfpSQa2nfVzUgNPwfGDdzu*@6SLAyd3</entry>
<entry>7r@ZQdXckXVzIVTdpg2nEFRJ7h*IZd52</entry>
<entry>GzazyelFpKWU8&amp;79IL.o6k5QS9gq2gVZ</entry>
@pgundlach
pgundlach / rng2adoc.xsl
Created Mar 22, 2018
Simple RELAX NG to adoc transformation
View rng2adoc.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
version="2.0">
<xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>
<xsl:variable name="startxml"><xsl:text>
[source, xml]
-------------------------------------------------------------------------------
@pgundlach
pgundlach / transform-fontawesome.xsl
Created Jun 27, 2017
XSL-Transformation of HTML style fontawesome include to a custom tag with code
View transform-fontawesome.xsl
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all">
<!--
This transformation turns <i class="fa fa-..."></i> into
<fa>&#x...;</fa>
This is useful for the layout files in the speedata Publisher.
https://github.com/speedata/publisher
@pgundlach
pgundlach / main.go
Created Sep 2, 2016
Extract the image shape to use with the speedata Publisher
View main.go
package main
import (
"encoding/xml"
"fmt"
"image"
"image/color"
"log"
"os/exec"
View keybase.md

Keybase proof

I hereby claim:

  • I am pgundlach on github.
  • I am patrickgundlach (https://keybase.io/patrickgundlach) on keybase.
  • I have a public key whose fingerprint is 703C 6BE8 A150 11E6 22B4 3BEC 6074 B788 B6D9 6FE5

To claim this, I am signing this object:

@pgundlach
pgundlach / layout.xml
Created Mar 16, 2015
Sample for table breaking across positioning areas
View layout.xml
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Pagetype name="true" test="true()">
<Margin left="1cm" right="1cm" top="1cm" bottom="1cm"/>
<PositioningArea name="foo">
<PositioningFrame width="5" height="10" row="1" column="1"/>
<PositioningFrame width="5" height="10" row="1" column="7"/>
</PositioningArea>
</Pagetype>
@pgundlach
pgundlach / cksum.go
Last active Oct 16, 2021
A simple version of the unix utility "cksum" in Go
View cksum.go
package main
import (
"bufio"
"fmt"
"io"
"os"
)
// A simple version of the unix utility "cksum" in Go
@pgundlach
pgundlach / xmlparser.lua
Created Apr 26, 2012
XML Parser based on lpeg
View xmlparser.lua
-- xml parser
local require,lpeg,io,select,string,type,tonumber,tostring=require,lpeg,io,select,string,type,tonumber,tostring
local w = w
local printtable=printtable
module(...)
bit = require('bit')
local C,P,R,S,V = lpeg.C,lpeg.P,lpeg.R,lpeg.S,lpeg.V
@pgundlach
pgundlach / ltxbarcode.lua
Created Mar 14, 2012
Strichcodes mit LuaTeX
View ltxbarcode.lua
module(...,package.seeall)
local add_checksum_if_necessary, mkpattern, split_number, calculate_unit, pattern_to_wd_dp
function generate_barcode(str)
-- Wenn nur 12 Ziffern übergeben werden, fügen wir die 13 hinzu
str = add_checksum_if_necessary(str)
-- Die kleinste Lücke / Strich ist ein siebtel der Breite einer Ziffer und damit
@pgundlach
pgundlach / ltxbarcode.lua
Created Dec 23, 2011
barcodes with LuaTeX
View ltxbarcode.lua
module(...,package.seeall)
local add_checksum_if_necessary, mkpattern, split_number, calculate_unit, pattern_to_wd_dp
function generate_barcode( str )
-- If we only pass 12 digits, the 13th will be added
str = add_checksum_if_necessary(str)
-- The smallest bar/gap is 1/7th the width of a digit.