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 tables #305

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sci-log-db/src/services/export-snippets.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {bind, BindingScope, ContextTags, inject} from '@loopback/core';
import {EXPORT_SERVICE} from '../keys';
import {Filecontainer, LinkType, Paragraph} from '../models';
import * as puppeteer from 'puppeteer';
import {Browser, launch as puppeteerLaunc} from 'puppeteer';
import {JSDOM} from 'jsdom';
import {RestBindings, Server} from '@loopback/rest';
import PDFMerger from 'pdf-merger-js';
Expand Down Expand Up @@ -217,7 +217,7 @@ export class ExportService {
}

async exportToPdf(snippets: Paragraph[], exportFile: string, title?: string) {
const browser = await puppeteer.launch({
const browser = await puppeteerLaunc({
executablePath: process.env.CHROME_BIN,
args: ['--no-sandbox'],
});
Expand All @@ -244,7 +244,7 @@ export class ExportService {
}

private async htmlToPDF(
browser: puppeteer.Browser,
browser: Browser,
exportFile: string,
htmlString: string,
) {
Expand Down
20 changes: 14 additions & 6 deletions sci-log-db/src/services/pdf.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*{
* {
max-width: 100%;
}

Expand All @@ -11,8 +11,7 @@ snippet>* {
margin-bottom: 0;
margin-top: 0;
background-color: rgb(255, 255, 255) !important;
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
word-wrap: break-word;
}

Expand Down Expand Up @@ -102,15 +101,24 @@ h1 {
text-align: center;
}

@page landscape {
size: A4 landscape;
margin-right: -50px;
margin-left: -50px;
margin-top: 0;
margin-bottom: 0;
}

table,
th,
td {
table-layout:fixed;
table-layout: fixed;
font-size: 10px;
width: 100%;
border-spacing:0;
border-spacing: 0;
border-collapse: collapse;
border: 1px solid black;
padding: 15px;
page: landscape;
}

img {
Expand Down