java - Drawing on a rendered pdf - Swing -


after being extremely annoyed @ lack of free software draw directly onto pdfs, i've decided write myself.

i aim achieve having sort of canvas widget in gui contents of pdf displayed underneath it, , record (and render) drawn onto screen , when saving file, save drawn .png (with transparent background) , overlay onto .pdf.

i've written stuff overlaying pdf (using itext), not sure how approach gui stuff. how should proceed rendering pdf? i've seen approach involving converting page of .pdf image (pdf-renderer) , chucking in swing, imagine have resolution issues (zooming).

another idea i've had render .pdf in swing element using viewer widget jpedal, i'm not sure how i'd set canvas.

so, how should approach this?
should general structure of interface?
i've not tried either of these options (i'm still investigating library interfaces). wanted seek advice (since it's base structure of program).

rendering pdfs incredibly complicated. develop abcpdf , guess have perhaps forty man years of investment in rendering side.

so if want should start limiting need do. either need ensure pdfs come uniform source uses restricted set of functionality, or need accept many of pdfs not render correctly.

next need decompress page content stream(s) break pdf operators. create system.drawing.bitmap or similar , use each of pdf drawing operators draw on drawing surface. find full details of operators in pdf spec available on adobe web site.

provided pdf source consistent, simple , uniform able sensible out within few weeks. happy coding :-)


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -