landscape PDF
BobCashStory opened this issue · 4 comments
BobCashStory commented
how can we generate a pdf in landscape mode ?
jmaupetit commented
By using a custom CSS file with the following media query:
@media print{
@page {
size: landscape
}
}
HTH
BobCashStory commented
I tried before ask, and it's not working, but all my css work, any idea ?
jmaupetit commented
Ok. Can you provide an example html+css files so that I can provide more relevant help?
BobCashStory commented
CSS
* Optional CSS to customize fonts, colors, syntax highlighting. */
/* @media print{@page {size: landscape}} */
/* @page {
size: landscape;
} */
@media print{
@page {
size: landscape
}
}
/* Normal */
@font-face {
font-family: Montserrat;
src: url(./Montserrat-Regular.ttf);
}
body {
font-family: 'Montserrat', sans-serif;
writing-mode: tb-rl;
}
MD
<img src="orcom.jpg" alt="Logo Orcom" style="width: 50%; display: block; margin-left: auto; margin-right: auto;" />
<center> <h1> MyData export - DBT </h1> </center>
## Table des matières :
1. [Dashboard](#dashboard)
1. [Compte de résultat](#b'DBT_Comptederesultat')
* [Evolution du CA](#b'DBT_EvolutionduCA')
* [Analyse performance](#b'DBT_Analyseperformance')
* [Focus charges](#b'DBT_Focuscharges')
* [Analyse pluriannuelle](#b'DBT_Analysepluriannuelle')
* [Synthèse](#b'DBT_Synthese')
2. [Trésorerie](#b'DBT_Tresorerie')
* [Capacité d'autofinancement](#b'DBT_Capacitedautofinancement')
* [Tableau de flux](#b'DBT_Tableaudeflux')
* [Evolution](#b'DBT_Evolution')
3. [Bilan](#b'DBT_Bilan')
* [Bilan N / N-1](#b'DBT_BilanNN1')
* [Ratios](#b'DBT_Ratios')
<div style="page-break-after: always;"></div>
<center> <h1>Dashboard</h1> </center> <a name="dashboard">
<img src="2020_03_19/eurus/orcom/dashboard.png" alt="dashboard" style="width: 100%;" />
<div style="page-break-after: always;"></div>
<center> <h2>Compte de résultat</h2> </center> <a name="b'DBT_Comptederesultat'">
### Evolution du CA <a name="b'DBT_EvolutionduCA'">
<img src="2020_03_19/eurus/orcom/DBT_EvolutionduCA.png" alt="Evolution du CA" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Analyse performance <a name="b'DBT_Analyseperformance'">
<img src="2020_03_19/eurus/orcom/DBT_Analyseperformance.png" alt="Analyse performance" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Focus charges <a name="b'DBT_Focuscharges'">
<img src="2020_03_19/eurus/orcom/DBT_Focuscharges.png" alt="Focus charges" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Analyse pluriannuelle <a name="b'DBT_Analysepluriannuelle'">
<img src="2020_03_19/eurus/orcom/DBT_Analysepluriannuelle.png" alt="Analyse pluriannuelle" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Synthèse <a name="b'DBT_Synthese'">
<img src="2020_03_19/eurus/orcom/DBT_Synthèse.png" alt="Synthèse" style="width: 100%;" />
<div style="page-break-after: always;"></div>
<center> <h2>Trésorerie</h2> </center> <a name="b'DBT_Tresorerie'">
### Capacité d'autofinancement <a name="b'DBT_Capacitedautofinancement'">
<img src="2020_03_19/eurus/orcom/DBT_Capacitédautofinancement.png" alt="Capacité d'autofinancement" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Tableau de flux <a name="b'DBT_Tableaudeflux'">
<img src="2020_03_19/eurus/orcom/DBT_Tableaudeflux.png" alt="Tableau de flux" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Evolution <a name="b'DBT_Evolution'">
<img src="2020_03_19/eurus/orcom/DBT_Evolution.png" alt="Evolution" style="width: 100%;" />
<div style="page-break-after: always;"></div>
<center> <h2>Bilan</h2> </center> <a name="b'DBT_Bilan'">
### Bilan N / N-1 <a name="b'DBT_BilanNN1'">
<img src="2020_03_19/eurus/orcom/DBT_BilanNN1.png" alt="Bilan N / N-1" style="width: 100%;" />
<div style="page-break-after: always;"></div>
### Ratios <a name="b'DBT_Ratios'">
<img src="2020_03_19/eurus/orcom/DBT_Ratios.png" alt="Ratios" style="width: 100%;" />
Created by Cashstory the 19 03 2020, all data in this file are private
Python:
md2pdf(pdf_file_path,
md_content=md_content,
md_file_path=None,
css_file_path='./md2pdf.css',
base_url='./')
print (f"PDF Created {pdf_file_path}")