dokuwiki-plugin-dw2pdf icon indicating copy to clipboard operation
dokuwiki-plugin-dw2pdf copied to clipboard

Toc Numbering different to Document number

Open JeremyOWO opened this issue 5 years ago • 1 comments

Hello all,

Is it possible to have just one global numbering for the document ?

Because today we have two parts:

  • The first numbering is for cover page and toc ( In my case : I/II and and II/II )
  • The second numbering start after TOC. ( 1/14 to 14/14 )

But I would like to have direclty 1/16 to 16/16. Do you have a solution to merge this two numbering into just once ?

Thanks

JeremyOWO avatar Apr 02 '20 13:04 JeremyOWO

I have no idea. I'm surprised it is using two numberings. Please provide an example for testing.

Klap-in avatar Oct 12 '22 18:10 Klap-in

This post may be a little older, but I have a simillar problem here.

The index page has it's own numbering.

I copied the default tpl template and changed to the needed minimum dw2pdf_Template.zip

I also tried different options, like firstpage or global, without '@PAGE@' of '@PAGES@'. The index site always seems to have it's own page index.

If you need further information, just let me know.

KKSG-RZService avatar Jul 24 '23 12:07 KKSG-RZService

I cannot reproduce it yet. I've test it with your pdf-template further default settings. Which settings did you use to add a ToC? Please provide the steps how you setup your pdf export, such that I'm able to reproduce. Thanks!

Klap-in avatar Jul 24 '23 20:07 Klap-in

Hi again, I put together some information and hope, that it helps. We're running on dokuwiki Version Release 2022-07-31a "Igor". Reason for that is some incompatibility with some other plugins. Main OS is CentOS 7.

dw2pdf.zip

The information are provided by simply go to a namespace and click the button on the right menu.

KKSG-RZService avatar Jul 25 '23 05:07 KKSG-RZService

Which settings do you use for dw2pdf in the Configuration Manager, especially for ToC?

Klap-in avatar Jul 25 '23 09:07 Klap-in

Plugin»dw2odf»toc => true plugin»dw2pdf»toclevels => default /null

image

KKSG-RZService avatar Jul 25 '23 09:07 KKSG-RZService

ah, I see now what you mean. This was due to a limitation of the library mPDF we use for generating pdfs. It first creates all the pages of the file which are added one-by-one, and on the end after processing the pages, it includes the ToC on the start. The final page numbering is only known after finishing the document. Because the library had troubes with guessing the right length of the ToC upfront, two set of pagenumbers are used.

I see in the code italic number is selected: https://github.com/splitbrain/dokuwiki-plugin-dw2pdf/blob/6d1b3a64fc56857a4bb99f6e64bad6f5f9eafca9/action.php#L443

I just saw that the mPDF library put effort in the ToC creation in v7. Might be there are improvements that could benefit us as well. Unfortunately I have no time for looking into this. Contributions are welcome. I expect removing the italic page numbering and not resetting it in the TOCpagebreakByArray() might do already something. But it needs testing.

Klap-in avatar Jul 26 '23 21:07 Klap-in

It appeared to be rather simple to fix, thanks to the improvements in the mPDF library.

Klap-in avatar Jul 29 '23 22:07 Klap-in