Skip to content

Instantly share code, notes, and snippets.

View johnthad's full-sized avatar

Thad Humphries johnthad

View GitHub Profile
@johnthad
johnthad / DocumentConverter.java
Created March 14, 2024 20:47 — forked from sachin-handiekar/DocumentConverter.java
Converting DOM Document to JDOM and vice versa
import org.jdom.JDOMException;
import org.jdom.input.DOMBuilder;
import org.jdom.output.DOMOutputter;
public class DocumentConverter {
public org.jdom.Document convertDOMtoJDOM(org.w3c.dom.Document input) {
DOMBuilder builder = new DOMBuilder();
org.jdom.Document output = builder.build(input);
@johnthad
johnthad / test.html
Created February 2, 2024 22:44
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@johnthad
johnthad / test.md
Created February 2, 2024 22:43
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@johnthad
johnthad / PDFUtil.java
Created May 24, 2022 17:49 — forked from jribble/PDFUtil.java
Flatten PDF documents using PDFBox
package pdfutil;
import org.apache.pdfbox.cos.COSArray;
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.COSStream;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDDocumentCatalog;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDResources;
@johnthad
johnthad / PemUtils.java
Created October 31, 2020 01:20 — forked from lbalmaceda/PemUtils.java
Pem Keys file reader for Java
//Copyright 2017 - https://github.com/lbalmaceda
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF