Open and read Word or PDF file in cURL SDK

Use REST API to read documents in cURL programmatically

Easily open Word, PDF documents with cURL. Our solution will provide you with everything you need to access document content.

View code snippet

Open and read documents in cURL

If you want to open a text file and work with the data in plain-text format, you can do it using the most basic features of the cURL language and operating system. As for reading office documents, presented in a wide variety of file formats (DOCX, DOC, PDF, RTF, ODT, HTML, etc.), this task is more difficult to solve, since such documents are described by complex tree-like data structures within the DOM model.

Our cURL library is a cloud-based solution that will allow you to open documents in any office and web format. This distributed approach gives you flexibility in software development using cURL language, as all resource-intensive document processing will take place on Aspose servers. All you need is to get private keys to access Cloud API in cURL code.

Programmatically read Word, PDF documents in cURL

You can iterate over document elements, or you can search for specific elements in the DOM tree. We provide a wide range of cURL functions both for working with the structure of the document and with the data contained in the document nodes.

The following cURL code example will help you quickly figure out how to load a document and perform some actions on it.

Upload a document you want to access
Run code
curl -v "https://api.aspose.cloud/v4.0/words/storage/file/Input.docx" \
     -X PUT \
     -H "Content-Type: multipart/form-data" \
     -H "Authorization: Bearer ####################" \
     -F FileContent="@file://%FileName%"

curl -v "https://api.aspose.cloud/v4.0/words/Input.docx/{nodePath}/paragraphs" \
     -X POST \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer ####################" \
     -d "{\"Text\":\"Reading and writing to the file in the cloud occurs automatically.\"}"

curl -v "https://api.aspose.cloud/v4.0/words/storage/file/Input.docx" \
     -X GET \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer ####################" \
Run code
  
Copy cURL code to the clipboard

How to read a document using cURL

  1. Install cURL command line tool
  2. Get your app keys to use Aspose.Words Cloud for cURL
  3. Pass the Bearer token in the Authorization header
  4. Read a document using cURL

Install cURL library to read documents

Download and install the curl utility. Please follow these Instructions to quickly get the necessary security credentials and access our REST API.

System Requirements

There are no special requirements for using this tool.

5%

Subscribe to Aspose Product Updates

Get monthly newsletters and offers directly delivered to your mailbox.

© Aspose Pty Ltd 2001-2025. All Rights Reserved.