Skip to content
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

[Bug] In 2.78.x PDF Footer search box appear when search is enable in docfx.json #10414

Open
JM2K69 opened this issue Nov 21, 2024 · 8 comments
Labels
bug A bug to fix

Comments

@JM2K69
Copy link
Contributor

JM2K69 commented Nov 21, 2024

Describe the bug
In my docfx.json file

      "pdfCoverPage":"./pdf/cover.html",
      "pdfFooterTemplate":"./pdf/footer.html"

To Reproduce
Steps to reproduce the behavior:

  1. pdfFooterTemplate content
<div style="width: 100%; font-size: 12px;">
  <div style="float: right; padding: 0 2em">
    <span class="pageNumber"></span> / <span class="totalPages"></span>
  </div>
</div>
  1. Build the site with docfx 2.78.1
    pdf file have a searchbox on the footer

Image

The cover page works but not the footer.
I was able to add image

  1. pdfFooterTemplate content
<style>
    @media print {
        @page {
            margin: 0 !important;
        }

        body {
            -webkit-print-color-adjust: exact;
            -moz-print-color-adjust: exact;
            -ms-print-color-adjust: exact;
            print-color-adjust: exact;
        }
    }
</style>
<div style="width: 100%; font-size: 12px;">
    <div style="text-align: center; padding: 0 2em"><img
            src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAYAAABjyArgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAekSURBVGhD7Zlba1VXEMf3c6nBV7GgUFuTgEUttpQWFewHsE8tBVtLaemDtKJVahuvRMUqlaC1KmhqBSnejuaiuZkTTTR3k3h7VfDBvomfYLp+s/ecrLOyz86JCkp04M9Ze2bW7Oz/mjXrkkhEKqIoktd4/nDifpKH5rYmudxxSVo7W6Tjart0dnfK1etd0t3XLTcGrkvfUK/0D/fL4M0BGRoZlKHRoRiuPTgyIAPOhg++Pa4PffMuBrFaO1s1Nu9obGmQi5cvyIXmnJxvOifnGs8qzjackTMXT08bGK9KsJHblm+VK9c6pKsnL92915Ss/u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/O337CdgVRlESBrz7490tHVoZlJ+WD6K1wbHTZ8noZYgy9ptlBXCqGv/2zi20vBF1+X1s5AqvI1nhfcILyRaniNZ4aIRP8D5nKO+fCenIYAAAAASUVORK5CYII=">
        <b> --- docfx 2.78.1 2024 © ---</b> <span class="pageNumber"></span> / <span class="totalPages"></span></div>

Image

Context (please complete the following information):

  • OS: Windows 11
  • Docfx version: [2.78.1]

Additional context
Add any other context about the problem here.

@JM2K69 JM2K69 added the bug A bug to fix label Nov 21, 2024
@JM2K69 JM2K69 changed the title [Bug] PDF Footer search box appear [Bug] In 2.78.1 PDF Footer search box appear Nov 24, 2024
@JM2K69
Copy link
Contributor Author

JM2K69 commented Nov 24, 2024

I try a new project the bug appear when the setting enableSearch is enabled in docfx.json

  1. _enableSearch disable
    Image
    I think the last element visible is the theme switcher.

  2. _enableSearch enable
    Image
    @filzrev

@JM2K69 JM2K69 changed the title [Bug] In 2.78.1 PDF Footer search box appear [Bug] In 2.78.x PDF Footer search box appear when search is enable in docfx.json Nov 26, 2024
@JM2K69
Copy link
Contributor Author

JM2K69 commented Nov 26, 2024

Still present in 2.78.2.

@filzrev
Copy link
Contributor

filzrev commented Dec 9, 2024

On current implementation.
It seems pdfHeaderTemplate/ pdfFooterTemplate don't support HTML files that are generated from markdown.
(cover page supports HTML file generated from markdown )

For pdfHeaderTemplate/ pdfFooterTemplate.
It need to specify HTML Fragment file path.
And need to copy HTML files as resource files.

@JM2K69
Copy link
Contributor Author

JM2K69 commented Dec 10, 2024

I will test with HTML ressources files.

@JM2K69
Copy link
Contributor Author

JM2K69 commented Dec 10, 2024

@filzrev It works but when I used Image in cover.html and an other one in footer #10416 the image on the footer is used in cover too Like this issue but I don't know if this merge is include in the version 2.78.2
ping @yufeih

I have to seperate html file

cover.html

<style>
@media print {
    @page {
        margin: 0 !important;
    }
    body {
        -webkit-print-color-adjust: exact;
        -moz-print-color-adjust: exact;
        -ms-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

</style>
<div style='width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center;'>
    <div class='d-flex flex-column min-vh-100 justify-content-center align-items-center'></div>
         <img src="../images/MS-Security_logo.png" class="rounded mx-auto d-block">
      <h1 style='align-self: center; margin: 1rem 2rem;'>blabla</h1>
      <h1 style='align-self: center; margin: 1rem 2rem;'>blabla</h1>
    </div>
</div>

footer.html

<div style="width: 100%; font-size: 12px;">
    <div style="text-align: center; padding: 0 2em"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAYAAABjyArgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAekSURBVGhD7Zlba1VXEMf3c6nBV7GgUFuTgEUttpQWFewHsE8tBVtLaemDtKJVahuvRMUqlaC1KmhqBSnejuaiuZkTTTR3k3h7VfDBvomfYLp+s/ecrLOyz86JCkp04M9Ze2bW7Oz/mjXrkkhEKqIoktd4/nDifpKH5rYmudxxSVo7W6Tjart0dnfK1etd0t3XLTcGrkvfUK/0D/fL4M0BGRoZlKHRoRiuPTgyIAPOhg++Pa4PffMuBrFaO1s1Nu9obGmQi5cvyIXmnJxvOifnGs8qzjackTMXT08bGK9KsJHblm+VK9c6pKsnL92915Ss/uE+JfDm2LCM3h6RsTujcuvuLbl9LwbtsTtjasNn0BFOH/oSo+t6XmMSOyQ513y+QDIET1OSo2JyXeaRgb2DvZqtkAaptTtrZcWnK2RGxQx/dBTosNXuqlXfm7du6qCQ0T39PZrNV65dKSK5oeWiXLiUi0luHCd5U80mqaqqmvAOdNjSPiQNL0OcxDfSsuCTCzFDo4OalXUH6mT27NlFwbOAb93BOu1LCSGbrxdI7iiUi6bWRmm4HJNMFv955KBUVlUW4ixfvlzWrl2roG16fA4cPjDhYwzYXpY4iU+kdZKyME7ukGbiys9WFgKBmTNnyurVq2Xbtm2Sz+cVtNFh833p29PbLcNjMclkMuUirsktcqm9uVAq/jl1QioqKuJ+K1fK/fv3WSCKBB02fPBN+6j6k8dfqjjYHCJd0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/veCQeNqcYZHBjUzAf+QpkVB71D+SWChY+tG21I9UtEaDOZrERA8KnTp16qI+5zPypnLXJZC1k5i5yNcLzIub2we5e/yEFwU1ujnPz3ZKH+AQaNOPS3gQRkStrHGCDHMvBFx0l8xrdpdkRma+UL05zRYqUEfoZCsulDG0JGE9O2abzLtmlt+fg0x82a3g83nZdfN0/D60o7aPjH5HA/+zRS6qBxLTlocHVpt2p2bTmd/ruRfHvkpmz6UTmt9pQr5R6V/cv3aUuwf9lz/O9jZtBa45/oyhX6+HWKmUFsLnt4l11Z+hfv9p+N6fSvo+T7YxJqttYUritXfbWqQA5ETeXSh6z3yS1cV7rYO3buKOhfIYw/rF33k26jRt10nuqFOzZ8rCyAJR8s0dLAPpsBNP0rhmIFF+AcBiDZz2QAeWxVIJKdBaCNzicWMECQO+xiHTpyqMhWCr74utDHf05D6OM/m/j2LPgS6ny/DExUKslkspva1GRb+MoBvtRc+pK55ZIL/D86rW2/k8HEf/Z/w3YppPn4Or+dgVSllgvqJosTmQhpk/3bnv9c4Esf+k61LPiSZgt1pWC+pX6nApPw2cT3LYFUpWLx+4sk15DTLRz7ZA4jEMixmnsFQBsdGavEusy/0JiTpcuWpsbMgv8H++205yz4viZpemuXA/O337CdgVRlESBrz7490tHVoZlJ+WD6K1wbHTZ8noZYgy9ptlBXCqGv/2zi20vBF1+X1s5AqvI1nhfcILyRaniNZ4aIRP8D5nKO+fCenIYAAAAASUVORK5CYII=">
        <b> --- Test logo © ---</b><span class="pageNumber"></span> / <span class="totalPages"></span>
    </div>
</div>

Image

or my html cover page looks like this

Image

@filzrev
Copy link
Contributor

filzrev commented Dec 11, 2024

It works but when I used Image in cover.html and an other one in footer #10416 the image on the footer is used in cover too Like this issue but I don't know if this merge is include in the version 2.78.2

It's expected to be fixed on v2.78.2.
I've tested with provided cover.html/footer.html files. but it can't be reproduced. (Specified image is displayed on cover page)

Is it able to provide files that can reproduce reported issue?

@JM2K69
Copy link
Contributor Author

JM2K69 commented Dec 11, 2024

It works but when I used Image in cover.html and an other one in footer #10416 the image on the footer is used in cover too Like this issue but I don't know if this merge is include in the version 2.78.2

Il est prévu qu’il soit corrigé sur la v2.78.2. J’ai testé avec les fichiers / fournis. Mais il ne peut pas être reproduit. (L’image spécifiée s’affiche sur la page de couverture)cover.html``footer.html

Est-il en mesure de fournir des fichiers capables de reproduire le problème signalé ?

@filzrev yes I can reproduce clone my repository JM2K69/Docfx_Fix_Header and run docfx --server docfx.json -p 80

docfx --serve .\docfx.json -p 80
Searching built-in plugins in directory C:\Users\JM2K69\.dotnet\tools\.store\docfx\2.78.2\docfx\2.78.2\tools\net9.0\any\...
Post processor ExtractSearchIndex loaded.
7 plug-in(s) loaded.
Building 3 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>ValidateConceptualDocumentMetadata)...
Building 3 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)...
Building 2 file(s) in TocDocumentProcessor(BuildTocDocument)...
Applying templates to 8 model(s)...
XRef map exported.
Extracting index data from 3 html files
Using Node.js v22.11.0 executable.

     toc.pdf ---------------------------------------- 100%
docs\toc.pdf ---------------------------------------- 100%

Serving "D:\docfx\2.78.2\_site" on http://localhost:80
Press Ctrl+C to shut down

PDF is like this

Image

@filzrev
Copy link
Contributor

filzrev commented Dec 11, 2024

Thanks for providing reproduceable code.
I can also reproduce reported issues.

On my environment. I'm using following configs (without ./)
And in this case it works as expected.

      "pdfCoverPage":"pdf/cover.html",
      "pdfFooterTemplate": "pdf/footer.html"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

2 participants