PDF / XPS redaction in a web browser

404 views
Skip to first unread message

Support

unread,
Oct 24, 2012, 8:49:31 PM10/24/12
to pdfnet-w...@googlegroups.com
Q:

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.

We have some code that converts xps documents to tiffs. The challenge is the redactions. Is there any way to do this with your product suite? If not, is there a way to open the documents in SilverDox and render the Canvas for each container to a tiff?
------------
A:
PDFNet includes support for redaction via ‘pdftron.PDF.Redactor’add-on (http://www.pdftron.com/pdfnet/features.html#Redaction).

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.

Support

unread,
Oct 24, 2012, 9:29:28 PM10/24/12
to pdfnet-w...@googlegroups.com
Q: Our requirement is to convert redacted xod files to redacted pdf files.
If I understand your suggestion, we would have to:
1. Convert the xod files to pdf
2. Apply the redactions to the pdfs using pdftron.PDF.Redactor
3. Convert the redaced pdf’s to tiffs.

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()).

Support

unread,
Oct 25, 2012, 6:17:06 PM10/25/12
to pdfnet-w...@googlegroups.com
Q:
 

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

2. Store the documents as pdf.   Convert them to xod whenever we need to display them.
3. Store the documents as xod.  Convert them to pdf whenever we need to generate tiffs.
----
A:
 
 

>  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.

Support

unread,
Oct 25, 2012, 6:54:02 PM10/25/12
to pdfnet-w...@googlegroups.com

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()

 

Support

unread,
Jan 17, 2013, 8:36:07 PM1/17/13
to pdfnet-w...@googlegroups.com

Q:

I am looking for a redaction tool /Pdf Viewer which will be part of my Document Management System developed in ASP.Net. I need to apply redaction in document by drawing a rectangular box over confidential text in my document. I have downloaded trial version of PDFTRON and I am integrating in my test application to check Redaction but I did’nt find any demo on how to apply Redaction interactively by drawing rectangle over text, also I am little confused whether I have to use Server  SDK or webViewer  i.e. are these same or Web Viewer includes Redaction functionality. Also what are licensing options for the above?
 
------------
A:
In order to redact original PDF document you would use 'pdftron.PDF.Redactor' PDFNet Add-on as shown in Redact sample project that comes as part of PDFNet SDK (http://www.pdftron.com/pdfnet/downloads.html). For example:

 

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.

 
 
Reply all
Reply to author
Forward
0 new messages