1.1.23 • Published 9 months ago

@ireceipt.pro/js v1.1.23

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@ireceipt-pro/js

Create PDF files or images from your HTML template.

npm npm NpmLicense GitHub last commit GitHub release

Examples

More information and examples are available on https://dashboard.ireceipt.pro

Invoice template invoice_for_services_h2lmu9s2Invoice template invoice_universal_e2wa2qvyInvoice template invoice_universal_k5gizy86
Invoice template invoice_universal_qg1oiingInvoice template invoice_universal_vzrt6k1s

Get Started

For the library to work, you will need an API key, which you can get at https://dashboard.ireceipt.pro. You can also find public template IDs there or create your own.

import { IReceiptPRO } from '@ireceipt.pro/js';

const irp = new IReceiptPRO(process.env.IRETAILPRO_API_KEY);

irp.createJpgFromPublicTemplate("invoice_universal_vzrt6k1s", {
  "invoice": {
    "number": "13",
    "date": "2023-10-03",
    "table": {
      "headers": [
        "NAME",
        "PRICE",
        "QTY",
        "AMOUNT"
      ],
      "rows": [
        {
          "values": [
            "Gorgeous Fresh Car",
            "$100.99",
            "6",
            "$605.94"
          ]
        },
        {
          "values": [
            "Incredible Rubber Bike",
            "$356.00",
            "1",
            "$356.00"
          ]
        },
        {
          "values": [
            "UX Services",
            "$100.00",
            "2",
            "$200.00"
          ]
        },
        {
          "values": [
            "Development Service",
            "$2000.00",
            "1",
            "$2000.00"
          ]
        }
      ]
    },
    "total": "$3161.94",
    "terms": [
      "Payment is due within 5 days",
      "Payment method CARD",
      "Card Details:",
      "Card Number: 4242-4242-4242-4242",
      "Sergey Dudko"
    ]
  },
  "from": {
    "companyName": "IReceipt PRO",
    "lines": [
      "Identification Number: 55891434",
      "911 Reece Freeway",
      "32390 Kraig Station",
      "East Rhea",
      "IR",
      "support@ireceipt.pro"
    ]
  },
  "to": {
    "companyName": "Morissette - Bogisich",
    "lines": [
      "969 Harber Expressway",
      "South Aishaton",
      "GB"
    ]
  },
  "localization": {
    "invoice": "INVOICE",
    "bill_to": "BILL TO",
    "date": "DATE",
    "total": "Total",
    "terms_and_conditions": "TERMS & CONDITIONS"
  }
}, {
  "width": 796,
  "height": 1126
})

Use

Available methods for generating PDF files and JPG, PNG, WEBP images from public or your personal templates:

methoddescription
createJpgFromPublicTemplateCreate JPG Image from public template
createPdfFromPublicTemplateCreate PDF File from public template
createPngFromPublicTemplateCreate PNG Image from public template
createWebpFromPublicTemplateCreate WEBP Image from public template
createJpgFromPrivateTemplateCreate JPG Image from private template
createPdfFromPrivateTemplateCreate PDF File from private template
createPngFromPrivateTemplateCreate PNG Image from private template
createWebpFromPrivateTemplateCreate WEBP Image from private template

All methods have the same arguments, for example:

const buffer: Buffer | ArrayBuffer = await createJpgFromPublicTemplate(templateId, args, size);
argumentdescriptionrequiredexample
templateIdtemplate id, you can find it on https://dashboard.ireceipt.protruegift_card_template_1
argsarguments for substitution in the templatetrue{"amount": "$25","name": "Gift Card","code": "#1234567890","color": "#ebfdff"}
sizethe size of the file being createdfalse{"width": 796,"height": 1126}

Project outline

The scheme of work looks like this: IReceipt PRO Flow

LICENSE

MIT

1.1.23

9 months ago

1.1.22

9 months ago

1.1.21

9 months ago

1.1.20

9 months ago

1.1.19

9 months ago

1.1.18

9 months ago

1.1.17

9 months ago

1.1.16

9 months ago

1.1.12

10 months ago

1.1.15

9 months ago

1.1.14

9 months ago

1.1.13

10 months ago

1.1.1

11 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.0.19

1 year ago

1.1.0

11 months ago

1.0.39

11 months ago

1.0.38

11 months ago

1.0.40

11 months ago

1.0.22

1 year ago

1.0.43

11 months ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.41

11 months ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.33

12 months ago

1.0.32

12 months ago

1.0.31

12 months ago

1.0.30

12 months ago

1.0.37

12 months ago

1.0.36

12 months ago

1.0.35

12 months ago

1.0.34

12 months ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.1

1 year ago