Skip to content

life888888/jpdfbookmarks-test-pdf-examples

Repository files navigation

jpdfbookmarks-test-pdf-examples

This project is used to generate a PDF of the jpdfbookmarks testing baseline.

1. System Requirement

  • JDK

  • Maven 3.6+

2. How to generate a baseline PDF for testing

Important
IMPORTANT
  • It takes a little download time for the first execution. Because you need to download the required fonts.

    • Downloaded fonts are placed in downloaded-resources under the user’s Home directory.

    • The downloaded fonts and Theme include Simplified Chinese(CN) , Traditional Chinese(TW) , Japanese(JP) , Korean(KR).

    • You can modify asciidoctor-pdf-cjk-resources/pom.xml to annotate the unnecessary language parts and not download them.

  • By default, test PDFs in four languages will be output at one time (Simplified Chinese (CN) , Traditional Chinese (TW) , Japanese (JP) , Korean (KR)) , if you don’t need four languages PDF , you can modify asciidoctor-pdf -cjk-examples/pom.xml Annotate unneeded language parts without output.

Converting asciidoc to PDF can use the process-resources goal (the default goal set in pom.xml):

$ mvn
# or
$ mvn -P pdf-include
  • Maven Profile: pdf-include , is set so that README_XX.adoc will go to include CHANGELOG.adoc.

The output PDF file please refer to output file list

$ mvn -P pdf-default
  • Maven Profile: pdf-default, is set so that README_XX.adoc will not include CHANGELOG.adoc.

The output PDF file please refer to output file list

$ mvn -P pdf-compress
  • Maven Profile: pdf-compress, is to set the output PDF to enable compression. After testing, it was found that the PDF file size with the set compression option can be reduced by 25%.

The output PDF file please refer to output file list

$ mvn -P pdf-compress-include
  • Maven Profile: pdf-compress-include, is set so that README_XX.adoc will include CHANGELOG.adoc. And the PDF has compression enabled. After testing, it was found that the PDF file size with the set compression option can be reduced by 25%.

The output PDF file please refer to output file list

3. Difference

Differences from the official original asciidoctor-maven-examples/asciidoctor-pdf-cjk-example:

  • Remove downloaded CJK fonts fonts and themes into asciidoctor-pdf-cjk-resources maven module

  • Change the download location to downloaded-resources in the user’s Home directory.

  • Avoid constantly downloading CJK fonts and themes for each execution.

  • Added asciidoctor-pdf-cjk-examples/README.adoc English version as a PDF control for non-CJK languages.

  • Added asciidoctor-pdf-cjk-examples/README-zh_TW.adoc, modified from README-zh_CN.adoc.

  • Modify README-jp.adoc , README-zh_CN.adoc , README-zh_TW.adoc about asciidoc INCLUDE.

  • Added PDF compression options.

4. Output file list

asciidoctor-pdf-cjk-examples/target
├── generated-docs
│   ├── README-jp.pdf
│   ├── README.pdf
│   ├── README-zh_CN.pdf
│   └── README-zh_TW.pdf
├── generated-docs-compress
│   ├── README-jp.pdf
│   ├── README.pdf
│   ├── README-zh_CN.pdf
│   └── README-zh_TW.pdf
├── generated-docs-compress-include
│   ├── README-jp.pdf
│   ├── README.pdf
│   ├── README-zh_CN.pdf
│   └── README-zh_TW.pdf
└── generated-docs-include
    ├── README-jp.pdf
    ├── README.pdf
    ├── README-zh_CN.pdf
    └── README-zh_TW.pdf

5. Maven Module

Split asciidoctor-pdf-cjk-example into:

  • asciidoctor-pdf-cjk-resources

  • asciidoctor-pdf-cjk-examples-pdf

Simplify the problem that asciidoctor-pdf-cjk-example pom.xml is too large.

5.1. asciidoctor-pdf-cjk-resources

Responsible for downloading fonts, Themes required by CJK.

5.2. asciidoctor-pdf-cjk-examples-pdf

Responsible for processing PDF conversion, need to depend on asciidoctor-pdf-cjk-resources.

6. jpdfbookmarks test report

The test results of opening the pdf of this project for jpdfbookmarks are organized in:

  • jpdfbookmarks-test-reports_zh_TW.adoc

  • jpdfbookmarks-test-reports.adoc