com3dian commited on
Commit
53cd408
·
verified ·
1 Parent(s): 097f902

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -152,24 +152,26 @@ if (summ_text is not None) or ('summ_text' in st.session_state):
152
  def generate_pdf(html_string):
153
  css = """
154
  @page {
155
- size: A4 landscape;
156
- margin: 20mm;
157
  }
158
  body {
159
  font-family: sans-serif;
160
- background-color: #45474B; /* Set background color to grey */
161
- color: #F5F7F8; /* Set font color to white */
 
162
  }
163
  .page {
164
  font-size: 16pt; /* Adjust the font size as needed */
165
- margin: 1cm; /* Optional: adjust margins */
 
166
  }
167
  """
168
  pdf = BytesIO()
169
  HTML(string=html_string).write_pdf(pdf, stylesheets=[CSS(string=css)])
170
  pdf.seek(0)
171
  return pdf
172
-
173
  def create_pdf_from_markdown_strings(markdown_strings):
174
  html_pages = [render_markdown_to_html(md) for md in markdown_strings]
175
 
@@ -180,7 +182,8 @@ if (summ_text is not None) or ('summ_text' in st.session_state):
180
  <style>
181
  .page {
182
  font-size: 16pt; /* Adjust the font size as needed */
183
- margin: 1cm; /* Optional: adjust margins */
 
184
  }
185
  </style>
186
  </head>
 
152
  def generate_pdf(html_string):
153
  css = """
154
  @page {
155
+ size: 1920px 1080px; /* Set page size to Full HD resolution */
156
+ margin: 0; /* Remove all margins */
157
  }
158
  body {
159
  font-family: sans-serif;
160
+ background-color: grey; /* Set background color to grey */
161
+ color: white; /* Set font color to white */
162
+ margin: 0; /* Remove body margin */
163
  }
164
  .page {
165
  font-size: 16pt; /* Adjust the font size as needed */
166
+ margin: 0; /* Remove margin from page content */
167
+ padding: 0; /* Remove padding from page content */
168
  }
169
  """
170
  pdf = BytesIO()
171
  HTML(string=html_string).write_pdf(pdf, stylesheets=[CSS(string=css)])
172
  pdf.seek(0)
173
  return pdf
174
+
175
  def create_pdf_from_markdown_strings(markdown_strings):
176
  html_pages = [render_markdown_to_html(md) for md in markdown_strings]
177
 
 
182
  <style>
183
  .page {
184
  font-size: 16pt; /* Adjust the font size as needed */
185
+ margin: 0; /* Remove margin from page content */
186
+ padding: 0; /* Remove padding from page content */
187
  }
188
  </style>
189
  </head>