Skip to content

Instantly share code, notes, and snippets.

View scobal's full-sized avatar

Mark Pope scobal

  • Bristol, UK
View GitHub Profile
@scobal
scobal / gist:6125427
Created July 31, 2013 19:40
Pdfbox table with line wrapping and custom column widths
private void drawTable(PDPage page, PDPageContentStream contentStream, float y, float margin, String[][] content, float[] colWidths) throws IOException {
final int rows = content.length;
final int cols = content[0].length;
final float rowHeight = 40f;
final float tableWidth = page.findMediaBox().getWidth() - margin - margin;
final float tableHeight = rowHeight * rows;
final float colWidth = tableWidth/(float)cols;
final float cellMargin=5f;
@scobal
scobal / draw_table
Created July 31, 2013 19:40
Pdfbox table with line wrapping and custom column widths
private void drawTable(PDPage page, PDPageContentStream contentStream, float y, float margin, String[][] content, float[] colWidths) throws IOException {
final int rows = content.length;
final int cols = content[0].length;
final float rowHeight = 40f;
final float tableWidth = page.findMediaBox().getWidth() - margin - margin;
final float tableHeight = rowHeight * rows;
final float colWidth = tableWidth/(float)cols;
final float cellMargin=5f;
public class KriegerHttpServer {
public static final String BASE_URI = "http://localhost:8080/krieger-web/";
private static HttpServer SERVER;
public static synchronized void stopServer() {
SERVER.stop();
SERVER = null;
}