@speresps/pdf-module 1.0.0 → 1.0.1

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.
package/README.md CHANGED
@@ -220,6 +220,7 @@ import {
220
220
  generatePDFText,
221
221
  generatePDFTextAndTable,
222
222
  generatePDFTextAndTableWithPagination,
223
+ existsPDF,
223
224
  downloadPDF,
224
225
  } from "@speresps/pdf-module";
225
226
  ```
@@ -232,6 +233,7 @@ import {
232
233
  generatePDFText,
233
234
  generatePDFTextAndTable,
234
235
  generatePDFTextAndTableWithPagination,
236
+ existsPDF,
235
237
  downloadPDF,
236
238
  } from "@speresps/pdf-module/server";
237
239
  ```
@@ -246,6 +248,7 @@ import {
246
248
  generatePDFText,
247
249
  generatePDFTextAndTable,
248
250
  generatePDFTextAndTableWithPagination,
251
+ existsPDF,
249
252
  downloadPDF,
250
253
  } from "@speresps/pdf-module/client";
251
254
  ```
@@ -737,7 +740,7 @@ The client download process:
737
740
  7. Starts the browser download.
738
741
  8. Revokes the temporary URL after the download is initiated.
739
742
 
740
- ### Server-Side Download / Read
743
+ ### Server-Side Download / Read / Exists
741
744
 
742
745
  Use the server API when you need to access the saved file as a Node.js Buffer:
743
746
 
@@ -21,6 +21,10 @@ export async function generatePDFTextAndTableWithPagination(data) {
21
21
  return await generatePdfService.PDFTextAndTableWithPagination(data);
22
22
  }
23
23
 
24
+ export async function existsPDF(fileName) {
25
+ return await pdfFileService.exists(fileName);
26
+ }
27
+
24
28
  export async function getPDFFile (fileName) {
25
29
 
26
30
  if (typeof fileName !== "string" || !fileName.trim()) {
@@ -1,8 +1,6 @@
1
1
  import generatePdfService from "../../service/generatePdfService.js";
2
2
  import pdfFileService from "../../service/pdfFileService.js";
3
3
 
4
-
5
-
6
4
  export async function generatePDFTable(data) {
7
5
  return await generatePdfService.PDFTable(data);
8
6
  }
@@ -21,4 +19,8 @@ export async function generatePDFTextAndTableWithPagination(data) {
21
19
 
22
20
  export async function downloadPDF(fileName) {
23
21
  return await pdfFileService.read(fileName);
22
+ }
23
+
24
+ export async function existsPDF(fileName) {
25
+ return await pdfFileService.exists(fileName);
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speresps/pdf-module",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A reusable PDF generation and document management module for Node.js and Next.js applications, supporting Persian RTL documents, customizable headers and footers, text and table templates, paginated reports, PDF file storage, and browser downloads.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -4,7 +4,8 @@ export {
4
4
  generatePDFTable,
5
5
  generatePDFText,
6
6
  generatePDFTextAndTable,
7
- generatePDFTextAndTableWithPagination
7
+ generatePDFTextAndTableWithPagination,
8
+ existsPDF
8
9
  } from "../../api/client/clientApi.js"
9
10
 
10
11
  export {
@@ -5,5 +5,6 @@ export {
5
5
  generatePDFText,
6
6
  generatePDFTextAndTable,
7
7
  generatePDFTextAndTableWithPagination,
8
- downloadPDF
8
+ downloadPDF,
9
+ existsPDF
9
10
  } from "../../api/server/serverApi.js"