当前位置: 首页>>代码示例>>Java>>正文


Java IPDFRenderOption类代码示例

本文整理汇总了Java中org.eclipse.birt.report.engine.api.IPDFRenderOption的典型用法代码示例。如果您正苦于以下问题:Java IPDFRenderOption类的具体用法?Java IPDFRenderOption怎么用?Java IPDFRenderOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IPDFRenderOption类属于org.eclipse.birt.report.engine.api包,在下文中一共展示了IPDFRenderOption类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setRunAndRenderOption

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
public void setRunAndRenderOption( String inputFile, String inputName,
		String boolVar1, String boolVar2 ) throws Exception
{
	copyResource_INPUT( inputName + ".rptdesign", inputName + ".rptdesign" );
	IReportRunnable runnable = engine
			.openReportDesign( new FileInputStream( new File( inputFile ) ) );
	IRunAndRenderTask task = engine.createRunAndRenderTask( runnable );
	IPDFRenderOption option = new PDFRenderOption( );
	option.setOutputFileName( outputPath + inputName + "_" + boolVar1 + "_"
			+ boolVar2 + ".pdf" );
	option.setOutputFormat( "pdf" );
	option.setOption( option.FIT_TO_PAGE, new Boolean( boolVar1 ) );
	option.setOption( option.PAGEBREAK_PAGINATION_ONLY, new Boolean(
			boolVar2 ) );
	task.setRenderOption( option );
	task.run( );
	task.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:PDFRenderOptionTest.java

示例2: setRenderOption

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
public void setRenderOption( String inputFile, String inputName,
		String boolVar1, String boolVar2 ) throws Exception
{
	String report_document = outputPath + inputName + ".rptdocument";
	createReportDocument( inputFile, report_document );
	reportDoc = engine.openReportDocument( report_document );
	IRenderTask taskRender = engine.createRenderTask( reportDoc );
	IPDFRenderOption optionRender = new PDFRenderOption( );
	optionRender.setOutputFileName( outputPath + inputName + "_render_"
			+ boolVar1 + "_" + boolVar2 + ".pdf" );
	optionRender.setOutputFormat( "pdf" );
	optionRender.setOption(
			optionRender.FIT_TO_PAGE,
			new Boolean( boolVar1 ) );
	optionRender.setOption(
			optionRender.PAGEBREAK_PAGINATION_ONLY,
			new Boolean( boolVar2 ) );
	taskRender.setRenderOption( optionRender );
	taskRender.render( );
	taskRender.close( );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:PDFRenderOptionTest.java

示例3: supportHtmlPagination

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
protected void supportHtmlPagination( )
{
	if ( ExtensionManager.PAPER_SIZE_PAGINATION.equals( pagination ) )
	{
		Object htmlPaginationObj = renderOptions
				.getOption( IHTMLRenderOption.HTML_PAGINATION );
		if ( htmlPaginationObj != null
				&& htmlPaginationObj instanceof Boolean )
		{
			boolean htmlPagination = ( (Boolean) htmlPaginationObj )
					.booleanValue( );
			if ( htmlPagination )
			{
				if ( renderOptions
						.getOption( IPDFRenderOption.FIT_TO_PAGE ) == null )
				{
					renderOptions.setOption(
							IPDFRenderOption.FIT_TO_PAGE, Boolean.TRUE );
				}
				renderOptions.setOption(
						IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,
						Boolean.TRUE );
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:RenderTask.java

示例4: close

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
public void close( ) throws BirtException
{
	int overFlowType = context.getPageOverflow( );
	if ( overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE )
	{
		float scale = calculatePageScale( this );
		if ( 1f == scale )
		{
			pageContent.setExtension( IContent.LAYOUT_EXTENSION, this );
			outputPage( pageContent );
			return;
		}
		this.setScale( scale );
		getBody( ).setNeedClip( false );
		updatePageDimension( scale, this );
	}
	else if ( overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE )
	{
		getBody( ).setNeedClip( false );
		updatePageDimension( this );
	}

	pageContent.setExtension( IContent.LAYOUT_EXTENSION, this );
	outputPage( pageContent );
	finished = true;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:PageArea.java

示例5: setPageOverflow

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
public void setPageOverflow( int pageOverflow )
{
	this.pageOverflow = pageOverflow;
	if ( pageOverflow != IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES )
	{
		autoPageBreak = false;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:LayoutContext.java

示例6: closeLayout

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
protected void closeLayout( ContainerContext currentContext, int index,
		boolean finished ) throws BirtException
{
	PageArea page = (PageArea) currentContext.root;
	int overFlowType = context.getPageOverflow( );
	context.setFinished( finished );
	if ( overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE )
	{
		float scale = calculatePageScale( currentContext, page );
		if ( 1f == scale )
		{
			((PageContext)currentContext).pageContent.setExtension( IContent.LAYOUT_EXTENSION, page );
			outputPage(((PageContext)currentContext).pageContent);
			return;
		}
		page.setScale( scale );
		updatePageDimension( scale, page );
	}
	else if ( overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE )
	{
		updatePageDimension( page );
	}

	((PageContext)currentContext).pageContent.setExtension( IContent.LAYOUT_EXTENSION, page );
	outputPage(((PageContext)currentContext).pageContent);
	if(contextList.size( )>0)
	{
		this.currentContext = contextList.get( 0 );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:31,代码来源:PageLayout.java

示例7: setupLayoutOptions

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
protected void setupLayoutOptions( )
{
	Object outputDisplayNone = options
			.get( IPDFRenderOption.OUTPUT_DISPLAY_NONE );
	if ( outputDisplayNone instanceof Boolean )
	{
		if ( ( (Boolean) outputDisplayNone ).booleanValue( ) )
		{
			context.setOutputDisplayNone( true );
		}
	}
	
	Object userAgent = options.get( IHTMLRenderOption.USER_AGENT );
	if ( userAgent != null )
	{
		//IE 7 can not support display=none on table column
		if ( isIE7( userAgent.toString( ) ) )
		{
			context.setOutputDisplayNone( false );
		}
	}
	
	Object taskType = options.get( EngineTask.TASK_TYPE );
	if ( taskType instanceof Integer )
	{
		int type = ( (Integer) taskType ).intValue( );
		if ( type == IEngineTask.TASK_RUN )
		{
			context.setLayoutPageContent( false );
			context.setOutputDisplayNone( true );
		}
	}
	
}
 
开发者ID:eclipse,项目名称:birt,代码行数:35,代码来源:HTMLReportLayoutEngine.java

示例8: getPages

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
private List getPages(boolean fitToPage, boolean pagebreakPaginationOnly ) throws EngineException
{
	PDFRenderOption options = createRenderOption();
	if (fitToPage)
	{
		options.setOption( IPDFRenderOption.PAGE_OVERFLOW, new Integer(IPDFRenderOption.FIT_TO_PAGE_SIZE) );	
	}
	options.setOption( IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY, new Boolean(pagebreakPaginationOnly) );

	return getPages( options );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:PDFPageLMTest.java

示例9: supportHtmlPagination

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void supportHtmlPagination( )
{
	if ( ExtensionManager.PAPER_SIZE_PAGINATION.equals( pagination ) )
	{
		Object htmlPaginationObj = renderOptions
				.getOption( IHTMLRenderOption.HTML_PAGINATION );
		if ( htmlPaginationObj != null
				&& htmlPaginationObj instanceof Boolean )
		{
			boolean htmlPagination = ( (Boolean) htmlPaginationObj )
					.booleanValue( );
			if ( htmlPagination )
			{
				if ( renderOptions
						.getOption( IPDFRenderOption.FIT_TO_PAGE ) == null )
				{
					renderOptions.setOption(
							IPDFRenderOption.FIT_TO_PAGE, Boolean.TRUE );
				}
				renderOptions.setOption(
						IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY,
						Boolean.TRUE );
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:28,代码来源:FixedRenderTask.java

示例10: needPagedExecutor

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
/**
 * @return true if BIRT render the report page by page. false if BIRT
 *         render the report as a whole page.
 */
protected boolean needPagedExecutor(List<long[]> pageSequences )
{
	if ( ExtensionManager.PAPER_SIZE_PAGINATION.equals( pagination ) )
	{
		/* if fixed-layout, need render page by page, or pagination may different with html in the following case:
		 * 1. element is set visibility to false in pdf format
		 * 2. element is set display to none
		 */
		Object repaginateForPDF = renderOptions
				.getOption( IPDFRenderOption.REPAGINATE_FOR_PDF );
		if ( repaginateForPDF != null
				&& repaginateForPDF instanceof Boolean )
		{
			if ( ( (Boolean) repaginateForPDF ).booleanValue( ) )
			{
				RenderTask.this.PDFRenderPageByPage = false;
			}
		}
		if ( RenderTask.this.PDFRenderPageByPage
				&& executionContext.isFixedLayout( ) )
		{
			return true;
		}
		
		// the output pages is sequential or there is no page sequence,
		// in this case, we can output the report content as a whole and
		// the HTML layout engine may re-paginate the content into
		// pages.
		if ( pageSequences == null )
		{
			return false;
		}
		if ( pageSequences != null && pageSequences.size( ) == 1 )
		{
			long[] pages = pageSequences.get( 0 );
			if ( pages[0] == 1
					&& pages[1] == reportDocument.getPageCount( ) )
			{
				return false;
			}
		}
		// the page sequence is defined by several segment, we can't
		// display the report as a whole as in this case the HTML layout
		// engine can't regenerate the pagination.
		return true;
	}
	int pageCount = getPageCount( );
	if ( pageCount == 1 )
	{
		return true;
	}
	IRenderOption renderOption = executionContext.getRenderOption( );
	HTMLRenderOption htmlRenderOption = new HTMLRenderOption(
			renderOption );
	boolean htmlPagination = htmlRenderOption.getHtmlPagination( );
	if ( !htmlPagination )
	{
		return false;
	}
	return true;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:66,代码来源:RenderTask.java

示例11: initialize

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
public void initialize( ) throws BirtException
{
	createRoot( );
	Color backgroundColor = PropertyUtil.getColor( pageContent.getComputedStyle( )
			.getProperty( StyleConstants.STYLE_BACKGROUND_COLOR ) );
	ReportDesignHandle designHandle = pageContent.getReportContent( )
			.getDesign( ).getReportDesign( );
	IStyle style = pageContent.getStyle( );
	
	String imageUrl = EmitterUtil.getBackgroundImageUrl( style,
			designHandle, pageContent.getReportContent( )
					.getReportContext( ) == null ? null : pageContent
					.getReportContent( ).getReportContext( )
					.getAppContext( ) );
	if ( backgroundColor != null || imageUrl != null )
	{
		boxStyle = new BoxStyle( );
		boxStyle.setBackgroundColor( backgroundColor );
		if ( imageUrl != null )
		{
			boxStyle.setBackgroundImage( createBackgroundImage( imageUrl ) );
		}
	}
	context.setMaxHeight( root.getHeight( ) );
	context.setMaxWidth( root.getWidth( ) );
	context.setMaxBP( root.getHeight( ) );
	layoutHeader( );
	layoutFooter( );
	updateBodySize( );
	
	context.setMaxHeight( body.getHeight( ) );
	context.setMaxWidth( body.getWidth( ) );
	
	int overFlowType = context.getPageOverflow( );
	if ( overFlowType == IPDFRenderOption.FIT_TO_PAGE_SIZE
			|| overFlowType == IPDFRenderOption.ENLARGE_PAGE_SIZE )
	{
		context.setMaxBP( Integer.MAX_VALUE );
	}
	else
	{
		context.setMaxBP( body.getHeight( ) );
	}
	maxAvaWidth = context.getMaxWidth( );
	context.resetUnresolvedRowHints( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:47,代码来源:PageArea.java

示例12: setupLayoutOptions

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
protected void setupLayoutOptions()
	{
		Object fitToPage = options.get(IPDFRenderOption.FIT_TO_PAGE);
		if(fitToPage!=null && fitToPage instanceof Boolean)
		{
			if(((Boolean)fitToPage).booleanValue())
			{
				context.setFitToPage(true);
			}
		}
		Object pageBreakOnly = options.get(IPDFRenderOption.PAGEBREAK_PAGINATION_ONLY);
		if(pageBreakOnly!=null && pageBreakOnly instanceof Boolean)
		{
			if(((Boolean)pageBreakOnly).booleanValue())
			{
				context.setPagebreakPaginationOnly(true);
			}
		}
		Object pageOverflow = options.get(IPDFRenderOption.PAGE_OVERFLOW);
		if( pageOverflow!=null )
		{
			int pageOverflowType = ((Integer)pageOverflow).intValue();
			context.setPageOverflow(pageOverflowType);
		}
		else
		{
			if ( context.fitToPage() )
			{
				context.setPageOverflow(IPDFRenderOption.FIT_TO_PAGE_SIZE);
			}
		}
		Object outputDisplayNone = options
				.get( IPDFRenderOption.OUTPUT_DISPLAY_NONE );
		if ( outputDisplayNone instanceof Boolean )
		{
			if ( ( (Boolean) outputDisplayNone ).booleanValue( ) )
			{
				context.setOutputDisplayNone( true );
			}
		}

		Object textWrapping = options.get(IPDFRenderOption.PDF_TEXT_WRAPPING);
		if(textWrapping!=null && textWrapping instanceof Boolean)
		{
			if(!((Boolean)textWrapping).booleanValue())
			{
				context.setTextWrapping(false);
			}
		}
		Object fontSubstitution = options.get(IPDFRenderOption.PDF_FONT_SUBSTITUTION);
		if(fontSubstitution!=null && fontSubstitution instanceof Boolean)
		{
			if(!((Boolean)fontSubstitution).booleanValue())
			{
				context.setFontSubstitution(false);
			}
		}
		Object bidiProcessing = options.get(IPDFRenderOption.PDF_BIDI_PROCESSING);
		if(bidiProcessing!=null && bidiProcessing instanceof Boolean)
		{
			if(!((Boolean)bidiProcessing).booleanValue())
			{
				context.setBidiProcessing(false);
			}
		}
//		Object hyphenation = options.get(IPDFRenderOption.PDF_HYPHENATION);
//		if(hyphenation!=null && hyphenation instanceof Boolean)
//		{
//			if(!((Boolean)hyphenation).booleanValue())
//			{
//				context.setEnableHyphenation(false);
//			}
//		}
	}
 
开发者ID:eclipse,项目名称:birt,代码行数:75,代码来源:PDFReportLayoutEngine.java

示例13: initOptions

import org.eclipse.birt.report.engine.api.IPDFRenderOption; //导入依赖的package包/类
protected void initOptions( )
{
	loadDefaultValues( "org.eclipse.birt.report.engine.emitter.config.odp" );
	// Initializes the option for BIDIProcessing.
	ConfigurableOption bidiProcessing = new ConfigurableOption(
			BIDI_PROCESSING );
	bidiProcessing
			.setDisplayName( getMessage( "OptionDisplayValue.BidiProcessing" ) ); //$NON-NLS-1$
	bidiProcessing.setDataType( IConfigurableOption.DataType.BOOLEAN );
	bidiProcessing
			.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
	bidiProcessing.setDefaultValue( Boolean.TRUE );
	bidiProcessing.setToolTip( null );
	bidiProcessing
			.setDescription( getMessage( "OptionDescription.BidiProcessing" ) ); //$NON-NLS-1$

	// Initializes the option for TextWrapping.
	ConfigurableOption textWrapping = new ConfigurableOption( TEXT_WRAPPING );
	textWrapping
			.setDisplayName( getMessage( "OptionDisplayValue.TextWrapping" ) ); //$NON-NLS-1$
	textWrapping.setDataType( IConfigurableOption.DataType.BOOLEAN );
	textWrapping.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
	textWrapping.setDefaultValue( Boolean.TRUE );
	textWrapping.setToolTip( null );
	textWrapping
			.setDescription( getMessage( "OptionDescription.TextWrapping" ) ); //$NON-NLS-1$

	// Initializes the option for fontSubstitution.
	ConfigurableOption fontSubstitution = new ConfigurableOption(
			FONT_SUBSTITUTION );
	fontSubstitution
			.setDisplayName( getMessage( "OptionDisplayValue.FontSubstitution" ) );
	fontSubstitution.setDataType( IConfigurableOption.DataType.BOOLEAN );
	fontSubstitution
			.setDisplayType( IConfigurableOption.DisplayType.CHECKBOX );
	fontSubstitution.setDefaultValue( Boolean.TRUE );
	fontSubstitution.setToolTip( null );
	fontSubstitution
			.setDescription( getMessage( "OptionDescription.FontSubstitution" ) ); //$NON-NLS-1$

	// Initializes the option for PageOverFlow.
	ConfigurableOption pageOverFlow = new ConfigurableOption(
			IPDFRenderOption.PAGE_OVERFLOW );
	pageOverFlow
			.setDisplayName( getMessage( "OptionDisplayValue.PageOverFlow" ) ); //$NON-NLS-1$
	pageOverFlow.setDataType( IConfigurableOption.DataType.INTEGER );
	pageOverFlow.setDisplayType( IConfigurableOption.DisplayType.COMBO );
	pageOverFlow
			.setChoices( new OptionValue[]{
					new OptionValue( IPDFRenderOption.CLIP_CONTENT,
							getMessage( "OptionDisplayValue.CLIP_CONTENT" ) ), //$NON-NLS-1$
					new OptionValue(
							IPDFRenderOption.FIT_TO_PAGE_SIZE,
							getMessage( "OptionDisplayValue.FIT_TO_PAGE_SIZE" ) ), //$NON-NLS-1$
					new OptionValue(
							IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES,
							getMessage( "OptionDisplayValue.OUTPUT_TO_MULTIPLE_PAGES" ) ), //$NON-NLS-1$
					new OptionValue(
							IPDFRenderOption.ENLARGE_PAGE_SIZE,
							getMessage( "OptionDisplayValue.ENLARGE_PAGE_SIZE" ) ) //$NON-NLS-1$
			} );
	pageOverFlow.setDefaultValue( IPDFRenderOption.CLIP_CONTENT );
	pageOverFlow.setToolTip( null );
	pageOverFlow
			.setDescription( getMessage( "OptionDescription.PageOverFlow" ) ); //$NON-NLS-1$

	// Initializes the option for chart DPI.
	ConfigurableOption chartDpi = new ConfigurableOption( CHART_DPI );
	chartDpi.setDisplayName( getMessage( "OptionDisplayValue.ChartDpi" ) ); //$NON-NLS-1$
	chartDpi.setDataType( IConfigurableOption.DataType.INTEGER );
	chartDpi.setDisplayType( IConfigurableOption.DisplayType.TEXT );
	chartDpi.setDefaultValue( new Integer( 192 ) );
	chartDpi.setToolTip( getMessage( "Tooltip.ChartDpi" ) );
	chartDpi.setDescription( getMessage( "OptionDescription.ChartDpi" ) ); //$NON-NLS-1$

	options = new IConfigurableOption[]{bidiProcessing, textWrapping,
			fontSubstitution, pageOverFlow, chartDpi};
	applyDefaultValues( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:80,代码来源:ODPEmitterDescriptor.java


注:本文中的org.eclipse.birt.report.engine.api.IPDFRenderOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。