com.java4less.rfax
Class AcrobatFaxProducer

java.lang.Object
  extended by com.java4less.rfax.AcrobatFaxProducer
All Implemented Interfaces:
FaxProducer

public class AcrobatFaxProducer
extends java.lang.Object
implements FaxProducer

creates a fax using PDF as data source. The class uses the PDF JavaBean from Acrobat, please download it from: http://www.adobe.com/products/acrviewer/acrvdnld.html#bean

Example code for faxing:

try {
AcrobatFaxProducer pdf=new AcrobatFaxProducer();
pdf.setPDFFile("c:\\report.pdf");
FaxModem fm= new FaxModem();
pdf.pageImage=new java.awt.image.BufferedImage(800,1290,java.awt.image.BufferedImage.TYPE_INT_RGB);

FaxModem m=new FaxModem();
m.setPortName("COM1");
m.flowControl=m.FLOWCONTROL_XONXOFF;
m.faxClass=1;
m.AtFBOR=true;
m.open(p);
if (m.sendFax("11111111")) System.out.println("Success ***");
else System.out.println("FAILED");
m.close();
}
catch ( Exception e ) { e.printStackTrace();}



Field Summary
 java.awt.Image pageImage
          image
 
Constructor Summary
AcrobatFaxProducer()
           
 
Method Summary
 java.awt.Image getFaxPage(int page)
          get page
 void setPDFByte(byte[] b)
          set PDF content, initialize everything
 void setPDFFile(java.lang.String file)
          set PDF File, initialize everything
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageImage

public java.awt.Image pageImage
image

Constructor Detail

AcrobatFaxProducer

public AcrobatFaxProducer()
Method Detail

getFaxPage

public java.awt.Image getFaxPage(int page)
Description copied from interface: FaxProducer
get page

Specified by:
getFaxPage in interface FaxProducer

setPDFFile

public void setPDFFile(java.lang.String file)
                throws java.lang.Exception
set PDF File, initialize everything

Throws:
java.lang.Exception

setPDFByte

public void setPDFByte(byte[] b)
                throws java.lang.Exception
set PDF content, initialize everything

Throws:
java.lang.Exception