View Single Post
Old 10-02-2009, 07:23 PM   #6
AlexC
Connoisseur
AlexC will become famous soon enoughAlexC will become famous soon enoughAlexC will become famous soon enoughAlexC will become famous soon enoughAlexC will become famous soon enoughAlexC will become famous soon enoughAlexC will become famous soon enough
 
AlexC's Avatar
 
Posts: 58
Karma: 737
Join Date: Oct 2007
Location: Vancouver
Device: Apple iPad; iRex iLiad
Sorry, haven't looked into highlighting or text notes.

I did get a question about exporting handwriting to a pdf. I'm not at my normal computer, but the script is fairly straightforward. Here's a simple kludgy example in R that should work. (Can't check at the moment as I don't have my Reader handy.)

Code:
#!/usr/bin/Rscript

# Convert Sony Reader Touch handwritten notes in directory to a multi-page pdf

output.file <- 'output.pdf'
line.width <- 2
line.colour <- 'black'

pdf(file=output.file, width=8.5, height=11)
files <- list.files(pattern='.note')
rot <- matrix(c(1, 0, 0, -1), ncol=2, byrow=TRUE)
for(file in files){
    par(mar=c(0, 0, 0, 0))
    plot(NULL, xlim=c(0, 600), ylim=c(-710, 0), type='n', axes=FALSE, xlab='', ylab='')
    file <- readLines(file)
    for(line in file){
        if(grepl('<xs1:polyline points=', line)){
            coords <- strsplit(strsplit(line, '\"')[[1]][2], ' ')[[1]]
            coords <- matrix(as.numeric(unlist(lapply(coords, strsplit, ','))), ncol=2, byrow=TRUE) %*% rot
            lines(coords, lwd=line.width, col=line.colour)
        }
    }
}
dev.off()
AlexC is offline   Reply With Quote