pdfbooklet 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pdfbooklet.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdfbooklet",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Create booklet from a pdf file suitable for compact printing",
5
5
  "main": "pdfbooklet.js",
6
6
  "bin": {
package/pdfbooklet.js CHANGED
@@ -221,8 +221,12 @@ if (!fs.existsSync(inputPdfPath)) {
221
221
  // Automatically generate the output filename by appending '-booklet' before '.pdf'
222
222
  outputPdfPath ||= inputPdfPath.replace(/\.pdf$/i, '-booklet.pdf');
223
223
 
224
+ if (outputPdfPath === inputPdfPath) {
225
+ err("Output file must not be same as input file");
226
+ }
227
+
224
228
  // Usage example
225
229
  createBooklet(inputPdfPath, outputPdfPath).catch(err => {
226
- console.error('Error creating booklet:', err);
230
+ err(`Error creating booklet: ${err}`);
227
231
  });
228
232