Skip to content

Commit

Permalink
fix pdf emitter repaginate issue
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Fang <jfang@opentext.com>
  • Loading branch information
jonfang committed Jul 22, 2019
1 parent 1cba3e3 commit 5387624
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Expand Up @@ -1879,7 +1879,15 @@ protected IReportLayoutEngine createReportLayoutEngine( String pagination,
IPDFRenderOption.RESERVE_DOCUMENT_PAGE_NUMBERS,
reserveDocumentPageNumbers );
}


Object repaginateForPDF = renderOptions
.getOption( IPDFRenderOption.REPAGINATE_FOR_PDF );
if ( repaginateForPDF != null )
{
layoutEngine.setOption( IPDFRenderOption.REPAGINATE_FOR_PDF,
repaginateForPDF );
}

Object userAgent = renderOptions.getOption( IHTMLRenderOption.USER_AGENT );
if ( userAgent != null )
{
Expand Down
Expand Up @@ -381,6 +381,17 @@ public boolean isReserveDocumentPageNumbers( )
{
if ( isFixedLayout )
{
// by default, fixed layout will always create pageExecutor
// according to reporting's page number and page accordingly.
// When repaginateForPDF is on, pageExecutor will not be created
// and layout engine will re-paginate accordingly
Object repaginateForPDF = htmlLayoutContext.getLayoutEngine( )
.getOption( IPDFRenderOption.REPAGINATE_FOR_PDF );
if ( repaginateForPDF != null
&& ( (Boolean) repaginateForPDF ).booleanValue( ) )
{
return false;
}
return true;
}
else
Expand Down

0 comments on commit 5387624

Please sign in to comment.