pdf-bookmark icon indicating copy to clipboard operation
pdf-bookmark copied to clipboard

获取网页目录乱码和无法生成C++Primer.Plus(第6版)中文版.pdf目录

Open chenzhujin opened this issue 4 years ago • 4 comments

点击生成目录没有任何反应,请作者指导

chenzhujin avatar Nov 02 '20 03:11 chenzhujin

使用 release 确实有这个问题。 可以试试直接在IntelliJ IDEA跑代码,我这边试了没问题可以用。

gongchunru avatar Dec 01 '20 02:12 gongchunru

同在线获取目录乱码,测试页面为 http://product.china-pub.com/195631 自己编译的版本

  • macOS 11.2.3
  • java 15.0.2
  • Gradle 6.8.3

fishiu avatar Mar 16 '21 12:03 fishiu

macOS 下乱码的原因是JavaFX获取系统默认字体时出现了问题,具体原因还不得而知,解决方法如下:

  1. 先在pdf-bookmark目录下添加resources文件夹
  2. resources目录下新建application.css
.root{
    -fx-font-size: 16pt;
    -fx-font-family: "Courier New";
    -fx-base: rgb(132, 145, 47);
    -fx-background: rgb(225, 228, 203);
}
  1. 修改pdf-bookmark/src/main/java/com/ifnoelse/pdf/gui/Main.java
        Scene scene = new Scene(vBox, 600, 400);
        scene.getStylesheets().add("application.css"); //添加内容
        primaryStage.setScene(scene);
  1. 修改build.gradle,最后面添加:
processResources {
    from('resources') {
        include 'application.css'
    }
}
  1. 重新运行:./gradlew jlink

youncyb avatar Jul 11 '21 11:07 youncyb

macOS 下乱码的原因是JavaFX获取系统默认字体时出现了问题,具体原因还不得而知,解决方法如下:

  1. 先在pdf-bookmark目录下添加resources文件夹
  2. resources目录下新建application.css
.root{
    -fx-font-size: 16pt;
    -fx-font-family: "Courier New";
    -fx-base: rgb(132, 145, 47);
    -fx-background: rgb(225, 228, 203);
}
  1. 修改pdf-bookmark/src/main/java/com/ifnoelse/pdf/gui/Main.java
        Scene scene = new Scene(vBox, 600, 400);
        scene.getStylesheets().add("application.css"); //添加内容
        primaryStage.setScene(scene);
  1. 修改build.gradle,最后面添加:
processResources {
    from('resources') {
        include 'application.css'
    }
}
  1. 重新运行:./gradlew jlink

第五步运行错误

  • What went wrong: A problem was found with the configuration of task ':jlink' (type 'JlinkTask').
    • In plugin 'org.beryx.jlink' type 'org.beryx.jlink.JlinkTask' property 'imageDirAsFile' is annotated with @PathSensitive but that is not allowed for 'OutputDirectory' properties.

      Reason: This modifier is used in conjunction with a property of type 'OutputDirectory' but this doesn't have semantics.

      Possible solution: Remove the '@PathSensitive' annotation.

      Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#incompatible_annotations for more details about this problem.

TtlyLynzie avatar Jun 15 '22 08:06 TtlyLynzie