Skip to content

Commit

Permalink
Small formatting and navigation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
GraylinKim committed Apr 21, 2014
1 parent a102d18 commit 9aa7924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/main/java/gov/nysenate/openleg/converter/PDFConverter.java
Expand Up @@ -53,24 +53,24 @@ public static void write(Transcript transcript, OutputStream out) throws IOExcep
contentStream.beginText();
contentStream.setFont(font, fontSize);

boolean firstLine = true;
int lineCount = 0;
for (String line : pageLines) {
line = line.trim();
String[] parts = line.split("\\s");
if (parts.length > 0 && parts[0].matches("[0-9]+")) {
if (firstLine) {
if (lineCount == 0) {
float offset = right-(parts[0].length()+1)*fontWidth;
contentStream.moveTextPositionByAmount(offset, top+fontWidth);
contentStream.drawString(parts[0]);
contentStream.moveTextPositionByAmount(-offset, -fontSize*2);
firstLine = false;
}
else {
float offset = left-(parts[0].length()+1)*fontWidth;
contentStream.moveTextPositionByAmount(offset, -fontSize);
contentStream.drawString(line);
contentStream.moveTextPositionByAmount(-offset, -fontSize);
}
lineCount++;
}
}

Expand All @@ -81,7 +81,10 @@ public static void write(Transcript transcript, OutputStream out) throws IOExcep
else {
stenographer = "Candyco Transcription Service, Inc.";
}
contentStream.moveTextPositionByAmount(left+ (right-left-stenographer.length()*fontWidth)/2, -fontSize*2);

// 27 because page# + 25 lines + 1 line stenographer offset
float offset = (lineCount-27)*2*fontSize;
contentStream.moveTextPositionByAmount(left+ (right-left-stenographer.length()*fontWidth)/2, offset);
contentStream.drawString(stenographer);

contentStream.endText();
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/views/transcripts.jsp
Expand Up @@ -55,10 +55,10 @@ $(document).ready(function() {
<div class="subcontent">
<% for(Transcript transcript : transcripts) { %>
<div class="row">
<span><a href="<%=JSPHelper.getLink(request, "/transcript/"+transcript.getOid()) %>">
<%=new SimpleDateFormat("MMM dd, yyyy").format(transcript.getTimeStamp()) %> <%=transcript.getType() %>
</a></span>
<span><%=new SimpleDateFormat("MMM dd, yyyy").format(transcript.getTimeStamp()) %> <%=transcript.getType() %></span>

<div style="float:right"><a href="<%=JSPHelper.getLink(request, "/api/2.0/transcript/"+transcript.getOid()+".pdf")%>">Download (PDF)</a></div>
<div style="float:right; padding-right:10px"><a href="<%=JSPHelper.getLink(request, "/transcript/"+transcript.getOid()) %>">View (HTML)</a></div>&nbsp;&nbsp;
</div>
<% } %>
</div>
Expand Down

0 comments on commit 9aa7924

Please sign in to comment.