Panduan Penggunaan
Ikuti langkah singkat berikut untuk mulai membuat template.
PDF Integration Guide
Welcome to the PDF Integration Guide! This document will walk you through the process of generating professional-quality PDF documents using Anywhere. Whether you're setting up basic configurations, defining your templates, or integrating PDF generation into your codebase, we'll help you create dynamic and pixel-perfect PDFs with ease.
1. Basic Configuration
To begin generating PDF documents, you'll first need to create a PDF template. Simply click New PDF in your Anywhere dashboard. From there, you can configure the settings to meet your specific requirements. Below are the key template configurations for PDF generation:
- Report Name (string): Assign a descriptive name for your report. This helps in organizing and identifying your PDF templates.
- Paper Type (radio button): Select the desired paper size for your PDF:
F4A4B5
- Data Source Type (radio button):
- POST: Choose this option to send data directly to Anywhere. The AnywhereWrapper can be utilized for this purpose.
- URL: Anywhere will fetch the necessary data by opening a specified URL.
- CSS from CDN (URL): Provide the address of a CSS CDN (e.g.,
<link href="http://example.com/assets/global/css/bootstrap.css" rel="stylesheet">). This allows you to style your PDF content using external stylesheets. - URL Data Source Here (URL): If you've selected "URL" as your data source type, enter the address where Anywhere should download the data.
- File Output (radio button): Determine how the generated PDF should be handled:
- Open directly in Browser: The PDF will be displayed directly in the user's web browser.
- Download: The PDF will be downloaded as a file.
- Note: If you're using AnywhereWrapper, data will automatically open directly in the browser.
- API URL (URL): The API endpoint for making requests to generate your PDF report.
- .html Designer (file): Use this section to design the HTML layout of your PDF report. You do not need to include standard
<html>,<head>, or<body>tags. The HTML designer adheres to the Puko Template Engine (PTE) rules, which you can learn more about here. - .css Designer (file): Design the CSS styles for your PDF report here. This CSS will automatically be linked to your
.htmldesigner content. - .json Data Sample: Provide a sample JSON data structure that corresponds to the placeholders used in your HTML template. This is invaluable for design and development.
2. Code Integration
Once your PDF template is configured, integrating PDF generation into your application is straightforward. Download the AnywhereWrapper, and you can write code similar to the example below:
require 'Wrapper.php';
$pdf = new Pdf(Wrapper::POST);
$pdf->setValue('Name', 'Someone');
$pdf->setValue('Age', '22');
$pdf->Send(API_URL);
If your request is successful, the browser will display the PDF file based on your template and provided data.
We hope this guide empowers you to create stunning and functional PDF documents with Anywhere! Feel free to explore and enhance your reporting capabilities. Happy coding!
Mail Integration Guide
Welcome to the Mail Integration Guide! This document will walk you through setting up and sending emails effortlessly using Anywhere. Whether you're configuring your basic mail settings, designing dynamic templates, or integrating email sending into your code, we'll ensure your messages reach their destination smoothly. Let's make email communication simple and efficient!
1. Basic Configuration
To start sending emails, you'll first need to create an email template. Simply click New MAIL in your Anywhere dashboard. From there, you can configure the settings to suit your specific needs. Below are the key template configurations for SMTP email:
- Email Name (string): This name will be used as the sender's name for your emails.
- Email Host (string): The hostname of your email service provider (e.g.,
smtp.mailgun.org,smtp.sendgrid.com). - Email Port (string): The SMTP port number provided by your email service. Common ports are 587 (TLS) or 465 (SSL).
- Email Username (string): Your email account's username.
- Email Password (string): Your email account's password.
- CSS from CDN (URL): The address of your CSS CDN (e.g.,
<link href="http://example.com/assets/global/css/bootstrap.css" rel="stylesheet">). This allows you to style your emails using external stylesheets. - Data Source Type (radio button):
- POST: Select this option to send data directly to Anywhere. You can use the AnywhereWrapper for this purpose.
- URL: Anywhere will fetch data from a specified URL.
- URL Data Source Here (URL): If you choose "URL" as your data source type, provide the address where Anywhere should retrieve the data.
- SMTP Auth (select): Choose
trueto enable SMTP authentication, orfalseto disable it. - SMTP Secure (select): Select your preferred security protocol:
TLSorSSL. - API URL (URL): The API endpoint for making email sending requests.
- .html Designer (file): Use this to design your email's HTML layout. You don't need to include
<html>,<head>, or<body>tags; just focus on the content. The HTML designer utilizes the Puko Template Engine (PTE) rules, which you can explore further here. - .css Designer (file): Design your email's CSS styles here. This CSS will automatically be linked to your
.htmldesigner content. - .json Data Sample: Provide a sample JSON data structure that matches the placeholders in your HTML template.
2. Code Integration
Once your template is configured, sending emails from your application is straightforward. Download the AnywhereWrapper, and you can send emails using code similar to the example below:
require 'Wrapper.php';
$mail = new Mail(Wrapper::POST);
$mail->setTo('example@gmail.com');
$mail->setCc('example@outlook.com');
$mail->setBcc('example@yahoo.co.id');
$mail->setSubject('Anywhere Wrapper');
$mail->setValue('Name', 'Anywhere');
$mail->setValue('Age', '22');
$mail->setAttachment('qrcode.png', 'http://oaas-divelliz.rhcloud.com/qr/render?data=admin@example.co.id');
$mail->setAttachment('qrcode1.png', 'http://oaas-divelliz.rhcloud.com/qr/render?data=developer@example.co.id');
$mail->Send(API_URL);
Important Note: Emails typically take a few minutes to arrive at their destination. Please be patient after sending.
If your request is successful, the email will be sent to the address specified in setTo().
We hope this guide helps you streamline your email communication through Anywhere! Should you have any questions, feel free to reach out. Happy emailing!
Excel Integration Guide
Welcome to the Excel Integration Guide! This document will walk you through the process of setting up and utilizing Anywhere to effortlessly generate Excel files. Whether you're configuring basic settings, defining your templates, or integrating with your codebase, we've got you covered. Let's make Excel generation simple and efficient!
1. Basic Configuration
Getting started with Excel generation is a breeze! Here, you'll find the fundamental steps to ensure your Anywhere platform is ready to produce stunning spreadsheets.
- API Key Setup: Before anything else, ensure your API key is correctly configured. This key acts as your secure credential, allowing Anywhere to authenticate your requests for Excel generation. You can usually find this in your Anywhere dashboard under "API Settings."
- Endpoint Definition: Understand the specific API endpoint dedicated to Excel generation. This is the URL where you'll send your data and template information.
- Required Libraries/Dependencies: If you're using a specific client library or SDK to interact with Anywhere, make sure it's properly installed and configured in your development environment.
2. Template Configuration
Templates are the heart of dynamic Excel generation. They define the structure, styling, and data placement within your spreadsheets. Think of them as blueprints for your Excel files!
- Designing Your Excel Template: Anywhere allows you to design your Excel templates using a combination of placeholders and standard Excel features. You can define cell styles, merged cells, formulas, and more.
- Placeholder Usage: Identify where your dynamic data will go by using placeholders (e.g.,
{{ productName }},{{ quantity }}). These placeholders will be replaced with actual data when you generate the Excel file. - Data Mapping: Learn how to map your JSON data structure to the placeholders in your Excel template. Anywhere provides intuitive ways to connect your incoming data with your template's dynamic fields.
- Template Storage: Understand how to upload and manage your Excel templates within the Anywhere platform. Your templates are securely stored and ready to be used whenever you need them.
3. Code Integration
Now for the exciting part: integrating Excel generation into your application! This section covers how to trigger Excel creation directly from your codebase using the Anywhere API.
- Choosing Your Programming Language: Anywhere's API is language-agnostic, meaning you can integrate it with any programming language (e.g., Python, Node.js, PHP, Java).
- Making API Requests: Learn how to construct and send API requests to the Excel generation endpoint. This typically involves sending your data (in JSON format) and specifying the template you wish to use.
- Handling Responses: Understand the structure of the API response, including how to handle successful generation (receiving the Excel file or a download link) and potential errors.
- Error Handling and Best Practices: Implement robust error handling in your code to manage scenarios like invalid API keys, malformed data, or template issues. Follow best practices for secure and efficient API communication.
We hope this guide makes your Excel generation journey smoother and more enjoyable. Happy coding!
Image Integration Guide
Welcome to the Image Integration Guide! This document will help you understand how to use Anywhere to generate dynamic images for your applications. From basic setup to advanced template configurations and seamless code integration, we'll guide you through making image generation simple, efficient, and visually appealing.
1. Basic Configuration
Starting with image generation is straightforward. These are the essential steps to get your Anywhere platform ready to create custom images.
- API Key Setup: Your journey begins with a properly configured API key. This key is crucial for authenticating your requests, allowing Anywhere to securely process your image generation commands. Locate your API key in the Anywhere dashboard under "API Settings."
- Endpoint Definition: Familiarize yourself with the specific API endpoint designated for image generation. This is the URL where your application will send data and template references to create images.
- Required Libraries/Dependencies: If you're leveraging client-side libraries or SDKs to interact with Anywhere, ensure they are correctly installed and configured within your development environment for smooth operation.
2. Template Configuration
Image templates are your creative canvas for dynamic visuals. They define the layout, elements, text, and styles that will be combined with your data to produce unique images.
- Designing Your Image Template: Anywhere supports designing image templates that can include various elements such as background images, text overlays, dynamic images, and shapes. You can use standard design tools or dedicated template builders.
- Placeholder Usage: Integrate placeholders into your image templates where dynamic content (text, image URLs) should appear (e.g.,
{{ userName }},{{ profilePictureUrl }}). These placeholders will be populated with data during generation. - Dynamic Element Placement & Styling: Learn how to precisely position and style dynamic text and images within your templates. This includes controlling fonts, colors, sizes, and layering effects to achieve your desired visual outcome.
- Data Mapping: Understand how to effectively map your JSON data structures to the dynamic elements and placeholders in your image templates. Anywhere provides flexible options to connect your input data with your template's design.
- Template Storage: Discover how to upload, organize, and manage your image templates within the Anywhere platform. Your templates are stored securely, ready for instant use.
3. Code Integration
This section details how to integrate dynamic image generation directly into your application's codebase using the Anywhere API.
- Choosing Your Programming Language: Anywhere's API is designed for compatibility across all major programming languages (e.g., Python, Node.js, PHP, Java, Ruby).
- Making API Requests: Learn the process of constructing and sending API requests to the image generation endpoint. You'll typically send your data (in JSON format) and specify the image template you wish to use.
- Handling Responses: Understand the structure of the API response, including how to retrieve the generated image (e.g., a direct image file, a URL to the image, or base64 encoded data) and how to manage potential errors.
- Error Handling and Best Practices: Implement robust error handling mechanisms in your code to gracefully manage scenarios such as invalid API keys, malformed data, or template processing issues. Adhere to best practices for secure and efficient API communication.
We're excited to see the amazing dynamic images you'll create! Feel free to explore the possibilities and enhance your application's visual appeal. Happy coding!