Skip to content

Commit

Permalink
PRINT logo bigger + product code full black
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreKelling committed Feb 20, 2024
1 parent f494ea0 commit ba62438
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspdf-product-label-54x70",
"version": "1.2.5",
"version": "1.2.6",
"main": "src/app.js",
"author": "André Kelling",
"description": "Dymo Label PDF printing 54 x 70mm.",
Expand Down
2 changes: 1 addition & 1 deletion src/print/partials/logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default (doc, logo) => {
const startY = doc.vars.startY.logo;
const pageWidth = doc.internal.pageSize.width;

const maxWidthFactor = 0.66;
const maxWidthFactor = 0.7;
const maxWidthInPx = Math.round((pageWidth * maxWidthFactor) * mmDpiFactor); // minus 4mm, 2mm spacing for each side
const maxHeightLogo = 9; // in mm from first startY for the productName
const maxHeightLogoInPx = Math.round(maxHeightLogo * mmDpiFactor); // minus 6mm, for spacing to top and 5 for better spacing and calculation at all
Expand Down
2 changes: 0 additions & 2 deletions src/print/partials/product-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default (doc, productCode, pageWidth) => {
let startY = doc.vars.startY.productCode;

doc.setFontSize(doc.vars.fontSizes.SmallFontSize);
doc.setTextColor(150, 150, 150);

// check if the product code is too long for the page ONCE
const stringWidthInMm = doc.getStringUnitWidth(productCode) * mmDpiFactor;
Expand All @@ -27,5 +26,4 @@ export default (doc, productCode, pageWidth) => {
}

doc.text(productCode, startX, startY, {maxWidth});
doc.setTextColor(0, 0, 0);
}

0 comments on commit ba62438

Please sign in to comment.