logo

  • HOME
  • PDF GENERATION

    PDF Generation consist of HTML to PDF, URL to PDF, CSV to PDF, EXCEL to PDF

    1:URL to PDF

    A module that converts URL to PDF, enabling seamless transformation of web content into portable document format.

    Available Methods


    MethodPOST
    URL /url-to-pdf
    Headerscontent-type: application/json
    Request Type json
    BODY PARAMETERS
    Attribute Description Type Required Option
    file_name File name, including the extension, e.g. example.pdf text false
    page_size Default: `A4`. text false A4
    A3
    A5
    Letter
    Legal
    Tabloid
    B5
    Custom Size : Height: text (e.g. 576) and Width: text (e.g. 360)
    margin_top Margin top in mm e.g. 1mm Default: 0mm text false
    margin_right Margin right in mm e.g. 1mm Default: 0mm text false
    margin_bottom Margin bottom in mm e.g. 1mm Default: 0mm text false
    margin_left Margin left in mm e.g. 1mm Default: 0mm text false
    url url text false
    custom_size_height e.g. 100mm or 100 text false
    custom_size_width e.g. 100mm or 100 text false


    Example response
    curl -X POST 'https://pdf.msquare.pro/url-to-pdf?appName=DocCrafter' \
                        -H 'content-type: application/json' \
                        -H 'authorization: ***' \
                        -d '{
                              "url": "https://en.wikipedia.org/wiki/PDF",
                              "file_name": "new.pdf",
                              "page_size": "A4",
                              "margin_top": "1mm",
                              "margin_left": "1mm",
                              "margin_right": "1mm",
                              "margin_bottom": "1mm"
                            }'

    2:HTML to PDF

    A module that converts HTML to PDF, enabling seamless transformation of web content into portable document format.

    Request Type 1

    Available Methods

    Method POST
    URL /html-to-pdf
    Headers content-type: application/json

    PARAMETERS
    Attribute Description Type Required Options
    url HTML File URL text true
    pdf_file_name File name, including the extension, e.g. invoice.pdf text false
    page_size Default: `A4`. text false A4
    A3
    A5
    Letter
    Legal
    Tabloid
    B5
    Custom Size : Height: text (e.g. 576) and Width: text (e.g. 360)
    margin_top Margin top in mm e.g. 1mm Default:0mm text false
    margin_right Margin right in mm e.g. 1mm Default: 0mm text false
    margin_bottom Margin bottom in mm e.g. 1mm Default: 0mm text false
    margin_left Margin left in mm e.g. 1mm Default: 0mm text false
    custom_size_height Margin bottom in mm e.g. 1mm Default: 0mm text false
    custom_size_width Margin left in mm e.g. 1mm Default: 0mm text false

    Request Type 2

    Available Methods

    POST

    Method POST
    URL /html-to-pdf
    Headerscontent-type: text/html
    PARAMETERS
    Attribute Description type Required
    file_name File name, including the extension, e.g. invoice.pdf text false
    page_size Default: `A4`. text false
    margin_top Margin top in mm e.g. 1mm Default: 0mm text false
    margin_right Margin right in mm e.g. 1mm Default: 0mm text false
    margin_bottom Margin bottom in mm e.g. 1mm Default: 0mm text false
    margin_left Margin left in mm e.g. 1mm Default: 0mm text false
    custom_size_height Margin left in mm e.g. 1mm Default: 0mm text True
    custom_size_width Margin left in mm e.g. 1mm Default: 0mm text True

    Example Response

     curl -X POST 'https://pdf.msquare.pro/html-to-pdf?appName=DocCrafter&page_size=A4&margin_top=1mm&margin_left=1mm&margin_right=1mm&margin_bottom=1mm&pdf_file_name=new.pdf' \
                    -H 'content-type: text/html' \
                    -H 'authorization: ***' \
                    -d 'HTML Content'

    3:CSV TO PDF

    A module that converts CSV to PDF, enabling seamless transformation of web content into portable document format.

    CSV URL

    Available Methods

    MethodPOST
    URL/csv-to-pdf
    Headers content-type: multipart/form-data
    PARAMETERS
    Attribute Description Type Required Options
    csv_url CSV File URL text true
    fileName File name, including the extension, e.g. example.csv text true file:name
    header_text_align text false LEFT
    RIGHT
    CENTER
    MIDDLE
    JUSTIFY
    header_text_color Hex Color Code e.g. `#000000` text false
    header_background_color Hex Color Code e.g. #000000 text false
    data_text_align text false LEFT
    RIGHT
    MIDDLE
    JUSTIFY
    CENTER
    data_text_color Hex Color Code e.g. #000000 text false
    data_background_color Hex Color Code e.g. #000000 text false
    table_grid_color Hex Color Code e.g. #000000 text false
    font_name text false Helvetica-Bold
    Helvetica
    Times-Roman or Courier
    font_size e.g. 10 number false
    page_size Default: A4 text false A4
    A3
    A5
    Letter
    Legal
    Tabloid
    B5
    100x200

    CSV DATA

    Available Methods

    MethodPOST
    URL /csv-to-pdf
    Headers content-type: multipart/form-data
    Body PARAMETERS
    Attribute Description Type Required Options
    file CSV file file true
    header_text_align text false LEFT
    RIGHT
    CENTER
    MIDDLE
    JUSTIFY
    header_text_color Hex Color Code e.g. `#000000` text false
    header_background_color Hex Color Code e.g. #000000 text false
    data_text_align text false LEFT
    RIGHT
    MIDDLE
    JUSTIFY
    CENTER
    data_text_color Hex Color Code e.g. #000000 text false
    data_background_color Hex Color Code e.g. #000000 text false
    table_grid_color Hex Color Code e.g. #000000 text false
    font_name text false Helvetica-Bold
    Helvetica
    Times-Roman or Courier
    font_size e.g. 10 number false
    page_size Default: A4 text false A4
    A3
    A5
    Letter
    Legal
    Tabloid
    B5
    100x200

    Example Request

     curl -X POST 'https://pdf.msquare.pro/csv-to-pdf?appName=DocCrafter' \
                        -H 'content-type: multipart/form-data' \
                        -H 'authorization: ***' \
                        -d '{
                          "csv_url": "https://people.sc.fsu.edu/~jburkardt/data/csv/nile.csv",
                          "font_name": "Helvetica-Bold",
                          "font_size": 6,
                          "page_size": "A4",
                          "data_text_align": "LEFT",
                          "data_text_color": "#000000",
                          "table_grid_color": "#000000",
                          "header_text_align": "CENTER",
                          "header_text_color": "#000000",
                          "data_background_color": "#000000",
                          "header_background_color": "#000000"
                        }'
                      

    4:EXCEL TO PDF

    A module that converts EXCEL to PDF, enabling seamless transformation of EXCEL content into portable document format.

    Available Methods

    Excel file url

    MethodPOST
    URL/excel-to-pdf
    HeadersContent-Type: multipart/form-data

    Body Parameters
    Attribute Description Type Required Options
    excel_file_url url of excel file text true
    header_text_align text false LEFT
    RIGHT
    CENTER
    MIDDLE
    JUSTIFY
    header_text_color Hex Color Code e.g. `#000000` text false
    header_background_color Hex Color Code e.g. #000000 text false
    data_text_align text false LEFT
    RIGHT
    MIDDLE
    JUSTIFY
    CENTER
    data_text_color Hex Color Code e.g. #000000 text false
    data_background_color Hex Color Code e.g. #000000 text false
    table_grid_color Hex Color Code e.g. #000000 text false
    font_name text false Helvetica-Bold
    Helvetica
    Times-Roman or Courier
    font_size e.g. 10 number false
    page_size Default: A4 text false A4
    A3
    A5
    Letter
    Legal
    Tabloid
    B5
    100x200

    Excel file data

    MethodPOST
    URL/excel-to-pdf
    HeadersContent-Type: multipart/form-data

    Body Parameters
    Attribute Description Type Required Options
    file Excel file file true
    header_text_align text false LEFT
    RIGHT
    CENTER
    MIDDLE
    JUSTIFY
    header_text_color Hex Color Code e.g. `#000000` text false
    header_background_color Hex Color Code e.g. #000000 text false
    data_text_align text false LEFT
    RIGHT
    MIDDLE
    JUSTIFY
    CENTER
    data_text_color Hex Color Code e.g. #000000 text false
    data_background_color Hex Color Code e.g. #000000 text false
    table_grid_color Hex Color Code e.g. #000000 text false
    font_name text false Helvetica-Bold
    Helvetica
    Times-Roman or Courier
    font_size e.g. 10 number false
    page_size Default: A4 text false A4
    A3
    A5
    Letter
    Legal
    Tabloid
    B5
    100x200

    Example Response

    curl -X POST 'https://pdf.msquare.pro/excel-to-pdf?appName=DocCrafter' \
                        -H 'content-type: multipart/form-data' \
                        -H 'authorization: ***' \
                        -d '{
                          "font_name": "Helvetica-Bold",
                          "font_size": 6,
                          "page_size": "A4",
                          "excel_file_url": "https://www.cmu.edu/blackboard/files/evaluate/tests-example.xls",
                          "data_text_align": "LEFT",
                          "data_text_color": "#000000",
                          "table_grid_color": "#000000",
                          "header_text_align": "CENTER",
                          "header_text_color": "#000000",
                          "data_background_color": "#000000",
                          "header_background_color": "#000000"
                        }'