Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cross-platform-pdf-generator

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-platform-pdf-generator - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

ressources/img.json

23

main.js
import { createPDFFromJSON } from "./PrintService.js";
import { createPrintOrder, getPrintInstruction, prepairPrintData } from "./StorageInterpreter.js";
//import fs from 'fs';
//import values from "./PDFtemplates/values.json";
//import { runDemo } from './StorageInterpreter.js';
/* DEBUG
import fs from 'fs';
import values from "./PDFtemplates/values.json";
import { runDemo } from './StorageInterpreter.js';
*/
//Public interface

@@ -75,7 +78,9 @@

*/
export function CreatePrintOrder(instructions, data, other) {
export function printServiceCreatePrintOrder(instructions, data, other) {
return createPrintOrder(instructions, data, other);
}
/*
/* DEBUG
function saveFile(name, bytes) {

@@ -93,5 +98,7 @@ return new Promise((resolve, rejects) => {

}
*/
//const bytes = await runDemo(values);
//await saveFile("test", bytes);
const bytes = await runDemo(values);
await saveFile("test", bytes);
*/
{
"name": "cross-platform-pdf-generator",
"version": "0.0.9",
"version": "0.1.0",
"description": "pulsation pdg generator for web and ios",

@@ -5,0 +5,0 @@ "main": "main.js",

import { PDFDocument, StandardFonts, rgb, PDFFont, PDFPage, PDFTextField } from 'pdf-lib';
import { Box } from "./utils/Box.js";
//import fs from 'fs';
import Img from "./ressources/img.json";

@@ -44,2 +44,11 @@ /**

const settings = Object.assign(
{
"valueSpacing": 8,
"fontSize": 11,
"lineHeight": 1.4
},
json?.documentSettings?.textSettings
);
if (template != null) {

@@ -61,11 +70,2 @@ const pdfDoc = await PDFDocument.load(template);

const settings = Object.assign(
{
"valueSpacing": 8,
"fontSize": 11,
"lineHeight": 1.4
},
json?.documentSettings?.textSettings
);
await fillPDFDocument(pdfDoc, firstPage, data, insets, initInsets, settings);

@@ -78,3 +78,4 @@ await printFooter(pdfDoc, json);

const pdfDoc = await PDFDocument.create()
await fillPDFDocument(pdfDoc, generateFakeData());
const page = pdfDoc.addPage();
await fillPDFDocument(pdfDoc, page, data, insets, initInsets, settings);
const pdfBytes = await pdfDoc.save();

@@ -426,6 +427,6 @@ return pdfBytes;

const font = await document.embedFont(StandardFonts.Helvetica);
//const img = await loadFile("./ressources/pulsation.png");
const img = Img.pulsation;
//create PDF Img
//const jpgImage = await document.embedPng(img);
const jpgImage = await document.embedPng(img);

@@ -432,0 +433,0 @@ let i = 1;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc