1. We have to display PDF/XPS documents in Silverlight (via SilverDox - http://www.pdftron.com/silverdox), create redactions, and save the redactions in a database.
2. After we’ve processed all of the documents, we need to put the documents through a system service that converts the documents to tiffs and burns in the redactions.
For an example of how to use Redactor please see PDFRedact sample project: http://www.pdftron.com/pdfnet/samplecode.html#PDFRedact
Based on your project description, it seems that you are developing a web based app and that you may be using SilverDox (http://www.pdftron.com/silverdox/samplecode.html) or the WebViewer (http://www.pdftron.com/pdfnet/webviewer/demo.html). Either way, you can use these browser API to add browser based redaction support by drawing custom annotations / rectangles.
However, the redaction process itself would not be done in the browser, but on the server where you would use ‘pdftron.PDF.Redactor’to apply the redactions to the original (PDF?) document.
If you need to view the final / redacted document in the WebViewer or Silverlight you can call pdftron.PDF.ToXod() to produce the redacted XOD.
PDFTron Redactor is a ‘vector based redactor’ and does not require conversion to TIFF etc. But it required you can always use pdftron.PDFDraw.Export() to convert redacted pages to TIFF or other image formats.
Is that what your suggesting?
A:
Since you are getting XOD from PDF, you can apply redactions directly on original PDF (with pdftron.PDF.Redactor), then export to redacted XOD and/or TIFF.
You can also do PDF -> XOD-> PDF -> redact -> XOD/TIFF but it just look less efficient.
When you save redactions in Silverdox you would save them as a very simple XML (e.g. XFDF) with a bunch of rectangles. You store this your DB. Only when you decide to apply redaction you load the rectangles (i.e. redact region) and apply the redaction on the original document (i.e. PDF) instead of the XOD.
You can then serve the customer with a redacted PDF (no conversion required, just PDFDoc.Save(“redacted.pdf”)), redacted XPS (with PDFDoc.Convert.ToXps(“redacted.xps”)), or redacted XOD (with PDFDoc.Convert.ToXod(“redacted.xod”)), or redacted TIFF (PDFDraw.Export()).
We have terabytes worth of documents. We can’t store the documents redundantly as xod and pdf. It sounds like the real problem is that xod is the best format for displaying documents in Silverlight, but we have to go through pdf in order to get tiffs. It sounds like our only options are:
1. Store the documents redundantly as both xod and pdf
> 1. Store the documents redundantly as both xod and pdf
This is the most CPU efficient option but ~ doubles the storage.
> 2. Store the documents as pdf. Convert them to xod whenever we need to display them.
This is the least CPU efficient option. Works only if you have very small server loads. For example, see WebViewerStreamin sample which is included as part of PDFNet SDK.
> 3. Store the documents as xod. Convert them to pdf whenever we need to generate tiffs.
This is may be a compromise between 1 & 2. Since the conversion from XOD to redacted document would not be frequent this is definitely more CPU efferent than option 2.
Q: If we only store things as xod, how to we convert them to pdf?
----
A: Since XOD is XPS, you can use pdftron.PDF.Convert.FromXps()
Q:
PDFNet.Initialize();
ArrayList rarr = new ArrayList();
rarr.Add(new Redactor.Redaction(1, new Rect(0, 0, 600, 600), true, "Top Secret"));
rarr.Add(new Redactor.Redaction(2, new Rect(30, 30, 550, 550), true, "Top Secret"));
using (PDFDoc doc = new PDFDoc("confidential.pdf")) {
doc.InitSecurityHandler();
Redactor.Appearance app = new Redactor.Appearance();
app.Font = new System.Drawing.Font("Arial", 12);
app.PositiveOverlayColor = System.Drawing.Color.Red;
app.NegativeOverlayColor = System.Drawing.Color.WhiteSmoke;
Redactor.Redact(doc, rarr, app);
doc.Save("redacted.pdf", SDFDoc.SaveOptions.e_linearized);
}
----
So to redact a PDF you just pass a collection of rectangles to 'Redactor.Redact'.
Now to let the user interactively define redaction regions (i.e. draw rects on content) you can use either the native PDF viewer control that comes as part of PDFNet SDK (e.g. PDFView sample) or you can use the WebViewer.
In either case you would either create a custom annotation tool ... or perhaps you can simply use built-in annotation tool (so no extra work required). In case you need a custom annotation tool as a desktop app MyPDFView.cs in PDFNet SDK. In case of WebViewer see Annotation related APIs (http://www.pdftron.com/pdfnet/webviewer/demo/html5/doc/index.html) and in case you wont to write a custom annotation ('WebViewer\html5\AnnotationNotes.txt'). In any case, I would just recommend using built-in rectangle annotations which can be exported to XML string via 'CoreControls.AnnotationManager SaveAnnotations()'. You would then send the XML string to server where you can load XFDF to FDFDoc (see http://www.pdftron.com/pdfnet/samplecode/FDFTest.cs) extract the list of annotation rectangles and pass them to 'Redactor.Redact'.
For a relevant post please see:
[WebViewer] PDF / XPS redaction in a web browser:
https://groups.google.com/d/topic/pdfnet-webviewer/jKtzGvbmNpU/discussion
Regarding licensing you should probably apply for it after you sort out technical things (e.g. what exactly component services you need). When you are ready please fill out http://www.pdftron.com/store/oem.html with detailed information and our sales will get back to you with a proposal.