DPI setting does not work in `newpage`

0 votes
asked Dec 17, 2018 in Bug by alphatan (180 points)

DPI setting does not work in newpage

  1. The script to reproduce the problem

    @startuml
    
    
    class A
    class B
    
    
    A }-- B
    
    
    newpage
    
    class A
    class B
    
    
    A }-- B
    
    
    @enduml
    
    
  2. Configuration File plantuml.config

    ''' setting dpi
    '' small   96 dpi (default, preview)
    '' medium 120 dpi
    '' big    144 dpi
    '' 
    '' image printing 300 dpi (hd)
    skinparam dpi 300
    
  3. Commandline

    java -Djava.awt.headless=true -DPLANTUML_LIMIT_SIZE=10240
    -Xmx1024m -jar "./plantuml.jar" -config "./plantuml.config"
    -charset utf-8 newpage_diagram.puml
    
  4. Problem PNG

    • The FIRST page is generated for dpi 300
    • The SECOND page (newpage) is generated for dpi 96
  5. Affected Versions

    • Since 2017.08 (at least)

1 Answer

0 votes
answered Dec 18, 2018 by plantuml (294,960 points)
selected Dec 19, 2018 by alphatan
 
Best answer
Thanks for the report.

This DPI issue is solved in last beta http://beta.plantuml.net/plantuml.jar

However it raises another question: maybe all skinparam settings (colors, fonts...) should be kept when using "newpage". Right now, all skinparam settings (but dpi now) are lost when creating a new page.

What do you guys think about it ?
commented Dec 19, 2018 by alphatan (180 points)
Is it an opportunity to introduce the concept of 'scope' ?

The idea

1. The configurations placed in the config file specified by command line
   argument `-config` will be put in the `global` scope, which will be applied
   to all files and all pages.
2. The configurations placed in the `global { ... }` statement will be put in
   the `file` scope, which will be applied to all pages defined in current file.
3. Other configuraions will be put in the `page` scope, which will be applied to
   the current page only. And the default configuration will be applied to the
   newpage.


Configuration priority line (high → low)

1. The `page` configuration
2. The `file` configuration
3. The `global` configuration in file
3. The `global` configuration from `-config`
4. The default configuration
commented Dec 19, 2018 by Serge Wenger Work (15,620 points)
PlantUML is an extraordinary tool. He has grown up in a sometimes somewhat organic way. There are more and more tools that generate files for PlantUML. Wouldn't it be time to make the syntax a little more orthogonal?

There are often several ways to write the same code (with aliases for example). This would allow to have a consistent syntax between the different types of diagrams and surely to have a simpler parsing code (for example for colorization or syntax control)

The first steps should be to define:
1) All diagrams with syntax diagrams (https://en.wikipedia.org/wiki/Syntax_diagram)
2) The notions of page, diagram, subdiagram, etc.
3) The scope of the skinparam, etc.
4)....

It's a big job, but I think it would be profitable in the long term
...