es.caib.ibkey.bpm.pdf.helper
Class PDFAFromImageGeneratorHelper

java.lang.Object
  extended by es.caib.ibkey.bpm.pdf.helper.PDFAGeneratorHelper
      extended by es.caib.ibkey.bpm.pdf.helper.PDFAFromImageGeneratorHelper

public class PDFAFromImageGeneratorHelper
extends PDFAGeneratorHelper

Classe per generar PDF/A a partir d'imatges.

Author:
u91940

Field Summary
protected  float bottomMargin
           
protected  byte[] imageBytes
           
protected  float leftMargin
           
protected  com.lowagie.text.Rectangle pageSize
           
protected  float rightMargin
           
protected  boolean rotateWhenWidthGreaterThanHeight
           
protected  boolean scaleImageToFitPage
           
protected  float topMargin
           
 
Constructor Summary
PDFAFromImageGeneratorHelper(byte[] imageBytes)
          Genera un PDF i hi incrusta una imatge.
 
Method Summary
protected  void customizeContent(com.lowagie.text.Document doc, com.lowagie.text.pdf.PdfWriter writer)
           
 float getBottomMargin()
           
 com.lowagie.text.Rectangle getDocumentPageSize()
           
 float getLeftMargin()
           
 float getRightMargin()
           
 float getTopMargin()
           
static void main(java.lang.String[] args)
           
protected  com.lowagie.text.Rectangle pageSizeFromImage(float height, float width, boolean verticalOrientation, boolean rotateWhenWidthGreaterThanHeight)
           
protected static void readBytes(java.io.FileInputStream in, java.io.ByteArrayOutputStream out)
           
protected  void scaleImageToFitPage(com.lowagie.text.Image image, com.lowagie.text.Rectangle pageSize2)
           
 void setBottomMargin(float bottomMargin)
           
 void setLeftMargin(float leftMargin)
           
 void setPageSize(com.lowagie.text.Rectangle pageSize)
           
 void setRightMargin(float rightMargin)
           
 void setRotateWhenWidthGreaterThanHeight(boolean rotateWhenWidthGreaterThanHeight)
           
 void setScaleImageToFitPage(boolean scaleImageToFitPage)
           
 void setTopMargin(float topMargin)
           
 
Methods inherited from class es.caib.ibkey.bpm.pdf.helper.PDFAGeneratorHelper
generatePDFA
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageBytes

protected byte[] imageBytes

scaleImageToFitPage

protected boolean scaleImageToFitPage

pageSize

protected com.lowagie.text.Rectangle pageSize

rotateWhenWidthGreaterThanHeight

protected boolean rotateWhenWidthGreaterThanHeight

topMargin

protected float topMargin

leftMargin

protected float leftMargin

bottomMargin

protected float bottomMargin

rightMargin

protected float rightMargin
Constructor Detail

PDFAFromImageGeneratorHelper

public PDFAFromImageGeneratorHelper(byte[] imageBytes)
                             throws ConversionException
Genera un PDF i hi incrusta una imatge.

Parameters:
imageBytes -
Throws:
ConversionException
Method Detail

getTopMargin

public float getTopMargin()
Returns:
the topMargin

setTopMargin

public void setTopMargin(float topMargin)
Parameters:
topMargin - the topMargin to set

getLeftMargin

public float getLeftMargin()
Returns:
the leftMargin

setLeftMargin

public void setLeftMargin(float leftMargin)
Parameters:
leftMargin - the leftMargin to set

getBottomMargin

public float getBottomMargin()
Returns:
the bottomMargin

setBottomMargin

public void setBottomMargin(float bottomMargin)
Parameters:
bottomMargin - the bottomMargin to set

getRightMargin

public float getRightMargin()
Returns:
the rightMargin

setRightMargin

public void setRightMargin(float rightMargin)
Parameters:
rightMargin - the rightMargin to set

setScaleImageToFitPage

public void setScaleImageToFitPage(boolean scaleImageToFitPage)

setPageSize

public void setPageSize(com.lowagie.text.Rectangle pageSize)

setRotateWhenWidthGreaterThanHeight

public void setRotateWhenWidthGreaterThanHeight(boolean rotateWhenWidthGreaterThanHeight)

customizeContent

protected void customizeContent(com.lowagie.text.Document doc,
                                com.lowagie.text.pdf.PdfWriter writer)
                         throws ConversionException
Specified by:
customizeContent in class PDFAGeneratorHelper
Throws:
ConversionException

scaleImageToFitPage

protected void scaleImageToFitPage(com.lowagie.text.Image image,
                                   com.lowagie.text.Rectangle pageSize2)

pageSizeFromImage

protected com.lowagie.text.Rectangle pageSizeFromImage(float height,
                                                       float width,
                                                       boolean verticalOrientation,
                                                       boolean rotateWhenWidthGreaterThanHeight)

readBytes

protected static void readBytes(java.io.FileInputStream in,
                                java.io.ByteArrayOutputStream out)
                         throws java.io.IOException
Throws:
java.io.IOException

getDocumentPageSize

public com.lowagie.text.Rectangle getDocumentPageSize()
Specified by:
getDocumentPageSize in class PDFAGeneratorHelper

main

public static void main(java.lang.String[] args)


Copyright © 2012 Direcció General de Tecnologia i Comunicacions. Govern de les Illes Balears. All Rights Reserved.