Skip to content

Instantly share code, notes, and snippets.

View mjbryant's full-sized avatar

Michael Bryant mjbryant

  • Stripe
  • Centennial, CO
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pdf_annotate import PdfAnnotator, Location, Appearance
from pdf_annotate.config import constants
from pdf_annotate.graphics import (
ContentStream, Save, BeginText, FillColor, EndText, Restore, Rect, Font, StrokeColor, Stroke
)
from pdf_annotate.annotations.text import get_text_commands
from pdf_annotate.annotations.text import FreeText
def add_text_with_rect(pdf):
a = PdfAnnotator(pdf)
from pdf_annotate import PdfAnnotator, Location, Appearance
from pdf_annotate.config import constants
from pdf_annotate.graphics import (
ContentStream, Save, BeginText, FillColor, EndText, Restore, Rect, Font, StrokeColor, Stroke
)
from pdf_annotate.annotations.text import get_text_commands
from pdf_annotate.annotations.text import FreeText
def add_text_with_rect(pdf):
a = PdfAnnotator(pdf)
@mjbryant
mjbryant / sqlalchemy_enum_test.py
Created August 8, 2019 23:00
SQLAlchemy deals with Enums oddly
import subprocess
from sqlalchemy import create_engine
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy import types
from sqlalchemy.exc import DataError
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from pdf_annotate import PdfAnnotator, Appearance, Location
annotator = PdfAnnotator('test.pdf')
annotator.add_annotation(
'square',
Location=Location(x1=10, y1=20, x2=100, y2=100, page=0),
Appearance=Appearance(fill=(1, 0, 0))
)
annotator.write('annotated.pdf')
@mjbryant
mjbryant / Dockerfile
Last active January 23, 2017 17:15
luarocks docker image
FROM ubuntu:xenial
MAINTAINER mbryant <mbryantj@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
unzip \
make \
build-essential \