/*
 * $Id: ClayMineralsSocietyPdfTransform.java,v 1.1 2010-09-01 21:14:46 pgust Exp $
 */ 

/*

Copyright (c) 2000-2010 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.plugin.ingenta;

import java.io.*;

import org.lockss.filter.pdf.*;
import org.lockss.util.*;

/**
 * This class contains PDF transforms that are specific for the Clay Minerals Society.
 * 
 * @author Philip Gust
 *
 */
public class ClayMineralsSocietyPdfTransform implements OutputDocumentTransform {

  @Override
  public boolean transform(PdfDocument pdfDocument,
                           OutputStream outputStream) {
    
    try {
        return IngentaPdfUtil.simpleTransform(pdfDocument, outputStream);
    }
    catch (IOException ioe) {
      IngentaPdfFilterFactory.logger.debug2("IOException in ClayMineralsSocietyPdfTransform", ioe);
      return false;
    }
  }

  @Override
  public boolean transform(PdfDocument pdfDocument) throws IOException {
    throw new IOException("ClayMineralsSocietyPdfTransform is an OutputDocumentTransform");
  }

}

@@ -49,29 +49,29 @@
 v 1.
-1
+2
  2010-
-09-01 21:14:46
+11-16 19:51:29
  pgu
@@ -1528,16 +1528,93 @@
 .pdf.*;%0A
+import org.lockss.filter.pdf.PageTransformUtil.ExtractStringsToOutputStream;%0A
 import o
@@ -1631,16 +1631,16 @@
 util.*;%0A
-
 %0A/**%0A * 
@@ -1985,75 +1985,647 @@
     
-  return IngentaPdfUtil.simpleTransform(pdfDocument, outputStream);
+if (%22RealPage PDF Generator 2.0%22.equals(pdfDocument.getCreator())) %7B%0A        IngentaPdfFilterFactory.logger.debug2(%22RealPage%22);%0A        %0A        // Extract all text%0A        return new TransformEachPage(new ExtractStringsToOutputStream(outputStream)).transform(pdfDocument);%0A      %7D%0A      else if (%22iText 2.0.7 (by lowagie.com)%22.equals(pdfDocument.getProducer())) %7B%0A        IngentaPdfFilterFactory.logger.debug2(%22iText%22);%0A        return IngentaPdfUtil.simpleTransform(pdfDocument, outputStream);%0A      %7D%0A      else %7B%0A        IngentaPdfFilterFactory.logger.debug2(%22None%22);%0A        pdfDocument.save(outputStream);%0A        return true;%0A      %7D
 %0A   

Update PDF transform to handle embedded fonts (and font names) that include gensyms.