@medicus.ai/medicus-report-pdf-generator 1.0.367 → 1.0.369

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  body {
2
2
  direction: rtl;
3
- font-feature-settings: normal !important;
4
- -webkit-font-feature-settings: normal !important;
5
- -moz-font-feature-settings: normal !important;
6
- font-family: 'Cairo',serif !important;
3
+ font-family: 'Cairo','Open Sans',sans-serif !important;
4
+ font-feature-settings: "zero" off !important;
5
+ -webkit-font-feature-settings: "zero" off !important;
6
+ -moz-font-feature-settings: "zero" off !important;
7
7
  }
8
8
 
9
9
  .biom-unit .biom-parent-unit.unit-text {
@@ -4,6 +4,7 @@
4
4
  font-weight: 400;
5
5
  src: url('OpenSans-Regular.ttf') format('truetype'),
6
6
  url('OpenSans-Regular.ttf') format('truetype');
7
+ unicode-range:U+0000-00FF !important;
7
8
  }
8
9
 
9
10
  @font-face {
@@ -17,6 +18,7 @@
17
18
  @font-face {
18
19
  font-family: 'Cairo';
19
20
  font-style: normal;
21
+ font-feature-settings: "zero" off !important;
20
22
  font-weight: 400;
21
23
  src: url('Cairo-Regular.ttf') format('truetype'),
22
24
  url('Cairo-Regular.ttf') format('truetype');
package/debug-font.png ADDED
Binary file
@@ -888,16 +888,15 @@ const generatePDFReport = async (data) => {
888
888
  });
889
889
  const page = await browser.newPage();
890
890
  debugLog("page launched!");
891
- await page.evaluate(async () => {
892
- await document.fonts.ready;
893
- await Promise.all([
894
- document.fonts.load('400 12px "Open Sans"'),
895
- document.fonts.load('400 12px "Cairo"')
896
- ]);
891
+
892
+ await page.evaluate(() => {
893
+ const usedFonts = Array.from(document.fonts).map(f => f.family);
894
+ console.log('Fonts in use:', usedFonts);
897
895
  });
896
+
898
897
  debugLog("fonts loaded!");
899
898
 
900
- await page.addScriptTag({ url: 'https://code.jquery.com/jquery-3.3.1.min.js' });
899
+ await page.addScriptTag({ url: 'https://code.jquery.com/jquery-3.3.1.min.js'});
901
900
  await page.setContent(contentHtml, { waitUntil: 'networkidle2', timeout: 30000 });
902
901
  await page.goto("file:///" + path.resolve(__dirname + `/../${Pdf_file}`), {
903
902
  timeout: 30000000,
@@ -905,12 +904,12 @@ const generatePDFReport = async (data) => {
905
904
  }).catch(e => {
906
905
  console.log("ERROR IS File path: " + e.message);
907
906
  });
908
-
907
+ await page.screenshot({ path: 'debug-font.png' });
909
908
  debugLog("page opened!");
910
909
 
911
910
  const buffer1 = await page.pdf({
912
911
  format: 'A4',
913
- printBackground: true,
912
+
914
913
  displayHeaderFooter: true,
915
914
  footerTemplate:footerTemplate,
916
915
  width: "220mm",
@@ -919,7 +918,8 @@ const generatePDFReport = async (data) => {
919
918
  bottom: '50px',
920
919
  left: '20px',
921
920
  right: '20px'
922
- }
921
+ },
922
+ printBackground: true,
923
923
  });
924
924
 
925
925
  debugLog("Buffer1 loaded!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medicus.ai/medicus-report-pdf-generator",
3
- "version": "1.0.367",
3
+ "version": "1.0.369",
4
4
  "description": "Nasco corporate report - latest update in 12/10/2023 - Fix HRC for bionext",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,12 +8,15 @@
8
8
  <link rel="stylesheet" href="../assets/Mediclinic/css/nasco_report_rtl.css" type="text/css">
9
9
  <link rel="stylesheet" href="../assets/Mediclinic/css/style.css" type="text/css">
10
10
  <style>
11
- {
12
- font-family: 'Cairo', sans-serif;
11
+ body, html {
12
+ font-family: 'Cairo', sans-serif !important;
13
13
  font-feature-settings: "zero" off !important;
14
14
  -webkit-font-feature-settings: "zero" off !important;
15
15
  -moz-font-feature-settings: "zero" off !important;
16
16
  }
17
+ @page {
18
+ font-family: 'Cairo', sans-serif !important;
19
+ }
17
20
  </style>
18
21
  <script>
19
22
  var IS_ARABIC = true;
package/test.js CHANGED
@@ -59,7 +59,7 @@ async function tttt() {
59
59
 
60
60
  // Write original PDF
61
61
  fs.writeFileSync(PDF_FILE_PATH, fileBuffer);
62
- await (async () => {
62
+ (async () => {
63
63
  const qpdf = await import('node-qpdf2');
64
64
  qpdf.encrypt({
65
65
  input: PDF_FILE_PATH,