@@ -0,0 +1,2898 @@
+/*%0A * $Id$%0A */%0A%0A/*%0A%0A Copyright (c) 2000-2016 Board of Trustees of Leland Stanford Jr. University,%0A all rights reserved.%0A%0A Permission is hereby granted, free of charge, to any person obtaining a copy%0A of this software and associated documentation files (the %22Software%22), to deal%0A in the Software without restriction, including without limitation the rights%0A to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A copies of the Software, and to permit persons to whom the Software is%0A furnished to do so, subject to the following conditions:%0A%0A The above copyright notice and this permission notice shall be included in%0A all copies or substantial portions of the Software.%0A%0A THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL%0A STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,%0A WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR%0A IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A%0A Except as contained in this notice, the name of Stanford University shall not%0A be used in advertising or otherwise to promote the sale, use or other dealings%0A in this Software without prior written authorization from Stanford University.%0A%0A */%0A%0Apackage org.lockss.plugin.highwire;%0A%0Aimport org.lockss.filter.pdf.ExtractingPdfFilterFactory;%0Aimport org.lockss.pdf.*;%0Aimport org.lockss.plugin.ArchivalUnit;%0Aimport org.lockss.util.Logger;%0A%0A%0A/**%0A * A pdf filter that handles the more challenging PDFs of child plugins where pdfplus%0A * files have non-substantive changes (annotation uris, ordering, etc). In this%0A * case scrape out the content text for comparison.%0A * This code modified from BaseAtyponScrapingPdfFilterFactory  @author alexohlson%0A *%0A */%0Apublic class HighWireDrupalScrapingPdfFilterFactory extends ExtractingPdfFilterFactory %7B%0A  %0A  private static final Logger log = Logger.getLogger(HighWireDrupalScrapingPdfFilterFactory.class);%0A  %0A  /*%0A   * Many pdf files have the CreationDate and ModDate and the two ID numbers in the trailer%0A   * vary from collection to collection. Filter them out to avoid incorrect hash failures.%0A   * This is a scraping filter to it also returns just the actual pdf content and not the layout.%0A   */%0A  @Override%0A  public void transform(ArchivalUnit au, PdfDocument pdfDocument) %0A      throws PdfException %7B%0A    %0A    pdfDocument.unsetCreationDate();%0A    pdfDocument.unsetModificationDate();%0A    pdfDocument.unsetMetadata();%0A    pdfDocument.unsetCreator();%0A    pdfDocument.unsetProducer();%0A    pdfDocument.unsetAuthor();%0A    pdfDocument.unsetTitle();%0A    pdfDocument.unsetSubject();%0A    pdfDocument.unsetKeywords();%0A    PdfUtil.normalizeTrailerId(pdfDocument);%0A    PdfUtil.normalizeAllTokenStreams(pdfDocument);%0A  %7D%0A%7D%0A%0A

Use Drupal PDF hash filter