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

landscape PDF #33

Open
BobCashStory opened this issue Mar 9, 2020 · 4 comments
Open

landscape PDF #33

BobCashStory opened this issue Mar 9, 2020 · 4 comments
Labels

Comments

@BobCashStory
Copy link

how can we generate a pdf in landscape mode ?

@jmaupetit
Copy link
Owner

By using a custom CSS file with the following media query:

@media print{
  @page {
    size: landscape
  }
}

HTH

@BobCashStory
Copy link
Author

I tried before ask, and it's not working, but all my css work, any idea ?

@jmaupetit
Copy link
Owner

Ok. Can you provide an example html+css files so that I can provide more relevant help?

@BobCashStory
Copy link
Author

BobCashStory commented Mar 20, 2020

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}")

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

No branches or pull requests

2 participants