-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom PDF configuration #6
Comments
Hi! Yes it is, depends on what you want to accomplish you will need to write some code. To change the default cover page, you just have to provide your own: new DefaultPdfReportBuilder()
...
.coverPage(new MyCoverPage())
.subTitle("Technical & Functional specifications")
Justifying text is a bit trickier since it depends on which text you want to justify:
Font color and size can also be customized per component e.g. new DefaultPdfReportBuilder()
.using(new Configuration()
.adjustFont(Styles.TABLE_HEADER_FONT, new FontModifier().size(10.0f))
.adjustFont(Styles. CODE_FONT, new FontModifier().size(10.0f))
) Keys to use may be found in Styles; You may need to look at dedicated emitter for all scenario based rendering, e.g. for steps rendering StepsEmitter. STEP_KEYWORD_FONT new DefaultPdfReportBuilder()
.using(new Configuration()
.adjustFont(Styles.TABLE_HEADER_FONT, new FontModifier().size(10.0f))
.adjustFont(Styles. CODE_FONT, new FontModifier().size(10.0f))
.adjustFont(StepsEmitter. STEP_KEYWORD_FONT, new FontModifier().bold().size(10.0f))
) Hope this helps, |
Hi, It helps, especially for the cover page, and I managed to add bookmarks from the table of contents with some custom Emitter, but I have to admit the text justification is beyond my reach for now. I don't see how by an emitter I can detect that it will handle some markdown text (or formula text). (I'm not sure exactly how emitter works in the pdf generation) Thanks again, Laurent |
markdown is 'Emitted' by MarkdownEmitter The complex part is that markdown is a complex structure that will 'sub-emit' fragments recursively (table, paragraph, list, bold, link...). For example the paragraph processor (ParaNodeProcessor delegates the processing of its children for bold, italic or nested list... By looking at the code, several years afterward, it seems that:
An example here: |
Formula is different, similar to ditaa diagram, rendering is drawn in the pdf directly. So that it is a vector which scale and render nicely when zooming in. |
Hello, Thanks again ! Laurent |
You are welcome! |
Hello,
Is it possible to add some custom pdf configuration ?
Like changing the first page or justify the text, center formula, etc.
Best regards
The text was updated successfully, but these errors were encountered: