CodeMash
  • 🚀Backend as a service
  • 🦄Roadmap
  • 🍕Release Notes
  • Installation
    • Managed Service
    • 🏗️AWS-CDK
    • 🏗️Azure
    • 🏗️Docker
    • 🏗️GC
    • 🏗️Terraform
  • dashboard
    • CodeMash Cloud
    • Project
    • Membership
      • Users
      • Roles
      • Policies
      • Triggers
      • Integrations
        • Apple
        • Azure
        • Facebook
        • Google
        • Twitter
      • Settings
    • Database
      • Collections
        • Schema
          • From Template
          • Structure
        • Tabs
        • Triggers
        • Indexes
        • Shared Forms
      • Taxonomies
        • Terms
        • Schema
        • Settings
      • Aggregation
      • Imports
      • Exports
      • Backups
    • Files
      • Integrations
        • CodeMash
        • S3 Bucket
    • Notifications
      • Push
        • Push Templates
        • Push Templates API
        • Push Notifications
        • Push Notifications API
        • Devices
        • Devices API
        • Integrations
          • Firebase
          • One Signal
          • Expo
      • Email
        • Email Templates
        • Emails
        • Integrations
          • AWS SES
          • Twilio Sendgrid
          • Mailgun
      • 🏗️Server events
      • 🏗️Sms
    • Payments
      • Integrations
        • Apple Pay
        • Google Pay
        • Stripe
        • Kevin.
        • Paysera
        • Decta
    • Scheduler
    • Logs & Monitoring
    • Code
      • Functions
        • Function Inputs
        • Function Templates
          • Node.js
          • Python
          • Ruby
          • Java
          • Go
          • .NET Core
      • CodeMash Functions
        • Google Functions
          • Google Calendar
          • Google Gmail
        • Microsoft Functions
          • Microsoft 365 Users
          • Microsoft 365 Calendar
        • Collection Find
        • Collection Update
        • Users Find
        • Image Resize
        • Html To Pdf
        • Word Document
        • Barcode
        • QR Code
        • Send Email
        • Send Notification
        • Email Reminder
        • Notification Reminder
      • Integrations
        • AWS Lambda
        • Google Cloud Functions
        • Azure Functions
  • Other Topics
    • Apple
      • Developer Portal
      • Bundle Identifier
      • Team ID
      • Service ID
      • Key ID
    • Triggers
    • Tokens Binding
      • Project Tokens
      • Initiator Tokens
      • Receiver Tokens
      • Request Tokens
      • Operation based tokens
      • Template Functions
    • Search parameters
      • Paging
      • Filter
      • Sort
      • Projection
    • data-models
    • Errors
  • SDK
    • Node.js
    • TypeScript
    • .NET
    • 🏗️Go Lang
    • 🏗️Flutter
    • 🏗️Swift
    • 🏗️Kotlin
  • CLI
    • 🏗️CodeMash CLI
  • API
    • Get Started
    • Prerequisites
    • How to test?
    • Cors
    • Project
    • Membership
      • Authentication
      • Users
    • Database
      • Collections
        • Aggregate
        • Change Responsibility
        • Count
        • Delete
        • Delete Many
        • Distinct
        • Find
        • Find One
        • Insert
        • Insert Many
        • References
        • Replace
        • Update
        • Update Many
      • Taxonomies
        • Find
    • Files
    • Code
    • Notifications
      • Push
      • Emails
      • Server Events
      • 🏗️Sms
    • Payments
    • Scheduler
    • Logs & Monitoring
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. dashboard
  2. Code
  3. CodeMash Functions

Html To Pdf

Create PDF from HTML

PreviousImage ResizeNextWord Document

Last updated 2 years ago

Was this helpful?

CodeMash's built-in function for generating PDF documents from HTML is a convenient and easy-to-use tool for creating PDF documents from your app or website. It is a serverless function deployed to the cloud, which means it runs on demand and is only charged for the execution time and resources used. This can be more cost-effective and scalable than running a traditional server-based solution.

To use the function, you simply provide the HTML content you want to include in the PDF document and any additional options or settings you want to apply. The function will then generate the PDF document and return it to you in a convenient format.

This built-in function can be especially useful for creating reports, invoices, or other documents that need to be delivered to customers or clients in a professional and standardized format. It can save you time and effort by automating the process of creating PDF documents, and it can help you to ensure that your documents are consistent and of high quality.

Enable the Html To Pdf function

  1. Log in to your CodeMash account and go to the Code module.

  2. Click on the "Functions" tab.

  3. Click on the "Add New" button.

  4. Select the "Html To Pdf" function from the list.

  5. Click the "Add Function" button to add the function to your project.

The function "Html To Pdf" has several properties that can be configured to customize its behavior. These properties include:

  • Display Name: Function name.

  • Description: This brief description of the function is displayed in the CodeMash user interface.

  • Tags: These are keywords that can be used to organize and categorize the function.

  • File Account: This is the name of the file account that will be used to store the generated PDF file.

  • Code: This is the C# code that will be executed before the HTML template is rendered. This can be used to customize the data available to the template.

  • Template HTML: This is the HTML template that will be used to generate the PDF file. The template can include tokens that will be replaced with data from the CodeMash database.

  • Configuration: This is a set of general PDF configuration options, such as margins, header display, and scaling. These can be used to customize the appearance and layout of the generated PDF file.