You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP code for [Api2Pdf REST API](https://www.api2pdf.com/documentation)
2
+
PHP code for [Api2Pdf REST API](https://www.api2pdf.com/documentation/v2)
3
3
4
-
Api2Pdf.com is a REST API for instantly generating PDF documents from HTML, URLs, Microsoft Office Documents (Word, Excel, PPT), and images. The API also supports merge / concatenation of two or more PDFs. Api2Pdf is a wrapper for popular libraries such as **wkhtmltopdf**, **Headless Chrome**, and **LibreOffice**.
4
+
Api2Pdf.com is a powerful REST API for instantly generating PDF and Office documents from HTML, URLs, Microsoft Office Documents (Word, Excel, PPT), Email files, and images. You can generate image preview or thumbnail of a PDF, office document, or email file. The API also supports merge / concatenation of two or more PDFs, setting passwords on PDFs, and adding bookmarks to PDFs. Api2Pdf is a wrapper for popular libraries such as **wkhtmltopdf**, **Headless Chrome**, **PdfSharp**, and **LibreOffice**.
5
5
6
6
-[Installation](#installation)
7
7
-[Resources](#resources)
@@ -28,13 +28,11 @@ Run the following from command line:
28
28
29
29
## Usage without Composer
30
30
31
-
Copy the files in the `src` directory to a sub-directory in your project, then add the following in the beginning of your PHP file:
31
+
Copy the file in the `src` directory to a sub-directory in your project, then add the following in the beginning of your PHP file:
32
32
33
33
```
34
34
require_once 'your-own-directory/Api2Pdf.php';
35
-
require_once 'your-own-directory/ApiResult.php';
36
35
37
-
use Api2Pdf\Api2Pdf;
38
36
```
39
37
40
38
## <aname="resources"></a>Resources
@@ -63,68 +61,56 @@ All usage starts by calling the import command and initializing the client by pa
63
61
64
62
Once you initialize the client, you can make calls like so:
An ApiResult object is returned from every API call. If a call is unsuccessful then an exception will be thrown with a message containing the result of failure.
72
70
73
-
Additional attributes include the total data usage in, out, and the cost for the API call, typically very small fractions of a penny.
71
+
Additional attributes include the total data usage out, and the cost for the API call, typically very small fractions of a penny.
LibreOffice supports the conversion to PDF from the following file formats:
185
-
186
-
- doc / docx
187
-
- xls / xlsx
188
-
- ppt / pptx
189
-
- gif
190
-
- jpg
191
-
- png
192
-
- bmp
193
-
- rtf
194
-
- txt
195
-
- html
188
+
Convert any office file to PDF, image file to PDF, email file to PDF, HTML to Word, HTML to Excel, and PDF to HTML. Any file that can be reasonably opened by LibreOffice should be convertible. Additionally, we have an endpoint for generating a *thumbnail* of the first page of your PDF or Office Document. This is great for generating an image preview of your files to users.
196
189
197
-
You must provide a URL to the file. Our engine will consume the file at that URL and convert it to the PDF.
190
+
You must provide a url to the file. Our engine will consume the file at that URL and convert it to the PDF.
198
191
199
192
**Convert Microsoft Office Document or Image to PDF**
## <aname="merge"></a>Merge / Concatenate Two or More PDFs
213
+
## <aname="merge"></a>PdfSharp - Merge / Concatenate Two or More PDFs, Add bookmarks to pdfs, add passwords to pdfs
212
214
213
-
To use the merge endpoint, supply a list of URLs to existing PDFs. The engine will consume all of the PDFs and merge them into a single PDF, in the order in which they were provided in the list.
215
+
To use the merge endpoint, supply a list of urls to existing PDFs. The engine will consume all of the PDFs and merge them into a single PDF, in the order in which they were provided in the list.
By default, Api2Pdf deletes your PDFs 24 hours after they have been generated. For developers who require higher levels of security and wish to delete their PDFs can make a DELETE request API call by using the `responseId`retrieved from the original request.
243
+
By default, Api2Pdf will delete your generated file 24 hours after it has been generated. For those with high security needs, you may want to delete your file on command. You can do so by making an DELETE api call with the `responseId`attribute that was returned on the original JSON payload.
Copy file name to clipboardExpand all lines: composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "api2pdf/api2pdf.php",
3
-
"description": "A client library for API2PDF service to convert HTML to PDF",
3
+
"description": "This client library is a wrapper for the Api2Pdf.com REST API. See full REST api documentation at https://www.api2pdf.com/documentation/v2. Api2Pdf is a powerful API that supports HTML to PDF, URL to PDF, HTML to Image, URL to Image, Thumbnail / image preview of an Office file, Office files (Word to PDF), HTML to Docx, HTML to excel, PDF to HTML, merge PDFs together, add bookmarks to PDFs, add passwords to PDFs",
0 commit comments