本文整理汇总了Java中org.apache.fop.apps.FOPException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java FOPException.getMessage方法的具体用法?Java FOPException.getMessage怎么用?Java FOPException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.fop.apps.FOPException
的用法示例。
在下文中一共展示了FOPException.getMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.apache.fop.apps.FOPException; //导入方法依赖的package包/类
protected void render(FopFactory fopFactory, FOUserAgent foUserAgent, String outputFormat, Source foDocumentSrc, PlaceholderReplacementHandler.PlaceholderLookup placeholderLookup, OutputStream outputStream) throws Docx4JException {
Fop fop = null;
Result result = null;
try {
if (foUserAgent==null) {
fop = fopFactory.newFop(outputFormat, outputStream);
} else {
fop = fopFactory.newFop(outputFormat, foUserAgent, outputStream);
}
result = (placeholderLookup == null ?
//1 Pass
new SAXResult(fop.getDefaultHandler()) :
//2 Pass
new SAXResult(new PlaceholderReplacementHandler(fop.getDefaultHandler(), placeholderLookup)));
} catch (FOPException e) {
throw new Docx4JException("Exception setting up result for fo transformation: " + e.getMessage(), e);
}
XmlSerializerUtil.serialize(foDocumentSrc, result, false, false);
}
示例2: startList
import org.apache.fop.apps.FOPException; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void startList(ListBlock lb) {
if (bDefer) {
return;
}
try {
// create an RtfList in the current list container
final IRtfListContainer c
= (IRtfListContainer)builderContext.getContainer(
IRtfListContainer.class, true, this);
final RtfList newList = c.newList(
ListAttributesConverter.convertAttributes(lb));
builderContext.pushContainer(newList);
} catch (IOException ioe) {
handleIOTrouble(ioe);
} catch (FOPException fe) {
log.error("startList: " + fe.getMessage());
throw new RuntimeException(fe.getMessage());
} catch (Exception e) {
log.error("startList: " + e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
示例3: writeOutputStream
import org.apache.fop.apps.FOPException; //导入方法依赖的package包/类
public static InputStream writeOutputStream(String fo,String outputFormat, OutputStream pdfOUT)
throws TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException
{
try
{
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
InputStream templateIS;
//out = new BufferedOutputStream(pdfOUT);
// Construct FOP with desired output format
//private FopFactory fopFactory = FopFactory.newInstance();
Fop fop = fopFactory.newFop(outputFormat, foUserAgent,pdfOUT );
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
// Setup input stream
templateIS = Text.toInputStream(fo);
Source src = new StreamSource(templateIS);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
return templateIS;
}
catch(FOPException e)
{
throw new SystemException(e.getMessage(),e);
}
}
示例4: getPageFormat
import org.apache.fop.apps.FOPException; //导入方法依赖的package包/类
/** {@inheritDoc} */
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException {
try {
if (pageIndex >= getNumberOfPages()) {
return null;
}
PageFormat pageFormat = new PageFormat();
Paper paper = new Paper();
Rectangle2D dim = getPageViewport(pageIndex).getViewArea();
double width = dim.getWidth();
double height = dim.getHeight();
// if the width is greater than the height assume landscape mode
// and swap the width and height values in the paper format
if (width > height) {
paper.setImageableArea(0, 0, height / 1000d, width / 1000d);
paper.setSize(height / 1000d, width / 1000d);
pageFormat.setOrientation(PageFormat.LANDSCAPE);
} else {
paper.setImageableArea(0, 0, width / 1000d, height / 1000d);
paper.setSize(width / 1000d, height / 1000d);
pageFormat.setOrientation(PageFormat.PORTRAIT);
}
pageFormat.setPaper(paper);
return pageFormat;
} catch (FOPException fopEx) {
throw new IndexOutOfBoundsException(fopEx.getMessage());
}
}
示例5: getPageFormat
import org.apache.fop.apps.FOPException; //导入方法依赖的package包/类
/** {@inheritDoc} */
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException {
try {
if (pageIndex >= getNumberOfPages()) {
return null;
}
PageFormat pageFormat = new PageFormat();
Paper paper = new Paper();
Rectangle2D dim = getPageViewport(pageIndex).getViewArea();
double width = dim.getWidth();
double height = dim.getHeight();
// if the width is greater than the height assume lanscape mode
// and swap the width and height values in the paper format
if (width > height) {
paper.setImageableArea(0, 0, height / 1000d, width / 1000d);
paper.setSize(height / 1000d, width / 1000d);
pageFormat.setOrientation(PageFormat.LANDSCAPE);
} else {
paper.setImageableArea(0, 0, width / 1000d, height / 1000d);
paper.setSize(width / 1000d, height / 1000d);
pageFormat.setOrientation(PageFormat.PORTRAIT);
}
pageFormat.setPaper(paper);
return pageFormat;
} catch (FOPException fopEx) {
throw new IndexOutOfBoundsException(fopEx.getMessage());
}
}
示例6: startInline
import org.apache.fop.apps.FOPException; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void startInline(Inline inl) {
if (bDefer) {
return;
}
try {
RtfAttributes rtfAttr
= TextAttributesConverter.convertCharacterAttributes(inl);
IRtfTextrunContainer container
= (IRtfTextrunContainer)builderContext.getContainer(
IRtfTextrunContainer.class, true, this);
RtfTextrun textrun = container.getTextrun();
textrun.pushInlineAttributes(rtfAttr);
textrun.addBookmark(inl.getId());
} catch (IOException ioe) {
handleIOTrouble(ioe);
} catch (FOPException fe) {
log.error("startInline:" + fe.getMessage());
throw new RuntimeException(fe.getMessage());
} catch (Exception e) {
log.error("startInline:" + e.getMessage());
throw new RuntimeException(e.getMessage());
}
}