New Feature: Find and Replace Words Using REST API

Following our recent release of the word count feature, we are happy to announce that we have now released a Find and Replace feature, for word documents.

We at Doc Conversion API, are focused on our customers and their success, and we believe that our success is represented by our customers’ success. That is why we listen to our customers’ needs and requests, and we spend our working hours analyzing and developing ways to bring these requests to life, while still maintaining the ease of use and reliability of our tools.

Almost everybody who uses a computer knows to how search for words in a document; however, you would need a special software to read this documents almost 99.9% of the time.

On top of that, the process of opening every document, searching for the words, and replacing them, can be quite time consuming, and as with everything, the more documents you have, the harder it becomes to remain accurate and maintain the same levels of efficiency.

This is why we have taken it upon ourselves to build a highly reliable, flexible yet simple, REST API to find and replace words in your documents. With this new feature, you can now easily find and replace any amount of words with a single API call, saving you’re the time and effort, and providing you great accurate results that you can immediately integrate in your process, without having to worry if you had missed anything.

Using The REST API to Find and Replace Words (CURL)

Doc Conversion API is compatible with all programming languages and frameworks; you can find a list of code examples here.

You can simply find and replace any words in your documents by making a POST request, using the below URL Along with your APP credentials (Application ID and Secret Key):

https://api.docconversionapi.com//utility/replace

To make the following curl request:

curl --request POST \
  --url 'https://api.docconversionapi.com//utility/wordcount' \
  --header 'X-ApplicationID: <Your_Application_ID>' \
  --header 'X-SecretKey: <Your_Application_SecretKey>' \
  --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  --form inputFile= <INPUT FILE PATH> \
  --form optionsJSON= {"searchItems": "OLD_WORD", "replaceItems": "NEW_WORD", "matchCase": "true", "matchWholeWord": "true"}'

Where:

X-ApplicationID   is your application ID

X-SecretKey                 is your secret ky

OutPutFormat   is HTML

InputFile          is the file you would to like to convert

optionsJSON    is a JSON String containing the word you would like to search and the word you would like to replace it with.

Using The REST API to Find and Replace Words (PHP)

Doc Conversion API is compatible with all main programming languages and frameworks; you can find a list of code examples here.

For this PHP example, we’re using a direct URL for our word document (the document we would like to use the find and replace feature for) for simplicity; you can also upload documents to the service or use your own linked storage files.

We’re going to be using this example:

https://www2.cdc.gov/cdcup/library/templates/CDC_UP_Test_Plan_Template.doc

Find and replace word example

We’re going to create a simple PHP page that reads the Doc file from a URL, and finds the word Test, and replaces it with new-test.

Find and replace PHP code

Download this page / View this page

This code will search for the word “Test”, and replace it with “new-test” in a newly created file.

output document after Find and Replace

If you have any questions or need any further help, please contact us at [email protected]

New Feature: REST API for Word Count

We at Doc Conversion API, continue to develop new features that will bring value to our customers and enhance their experience. That’s why we’re happy to announce that we have now released a new word count feature for word documents (.doc, .docx, etc).

The new word count feature has been highly requested by our customers, and we believe that it will make a big difference, as it is super simple, accessible and easy to use. Anyone can use it, even without any programming background.

Finding your word count is easy if you have a single document or two, but when you have a large number of documents to process and go through, it can be quite time consuming and it becomes increasingly difficult to maintain accuracy.

Instead of writing long pieces of code and wasting your time going through the iterations of testing and optimizing your code, we have now created an optimum solution for you; an easy to use, highly reliable, REST API that you can just call into with a few simple lines, to get your documents word count.

This feature will give you the exact number of words in your documents, and it supports Word documents only at the moment, so extensions like (.doc, .docx, etc) are all supported, with clear plans of expanding this feature in the future to cover more document formats.

Using the REST API to find your word count (CURL)

Doc Conversion API is compatible with all programming languages and frameworks; you can find a list of code examples here.

You can simply find the word count for your documents by making a POST request, using the below URL Along with your APP credentials (Application ID and Secret Key):

https://api.docconversionapi.com//utility/wordcount

To make the following curl request:

curl --request POST \
 --url 'https://api.docconversionapi.com//utility/wordcount' \
 --header 'X-ApplicationID: <Your_Application_ID>' \
 --header 'X-SecretKey: <Your_Application_SecretKey>' \
 --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
 --form inputFile= <INPUT FILE PATH> \
 --form optionsJSON=

Where:

X-ApplicationID is your application ID

X-SecretKey                 is your secret ky

OutPutFormat   is HTML

InputFile          is the file you would to like to convert

optionsJSON    is a JSON String containing any additional options relevant to the request type.

Using the REST API to find your word count (PHP)

Doc Conversion API is compatible with all main programming languages and frameworks; you can find a list of code examples here.

For this PHP example, we’re using a direct URL for our word document (the document we would like to find the word count for) for simplicity; you can also upload documents to the service or use your own linked storage files.

We’re going to be using this example (this document has 39 words):

http://homepages.inf.ed.ac.uk/neilb/TestWordDoc.doc

We’re going to create a simple PHP page that reads the Doc file from a URL, and finds the total number of words in this file:

PHP code to get the word count using Doc Conversion APIDownload this page / View this page

 

This code will execute the word count, and display the number of words (769) as an HTML page.

If you have any questions or need any further help, please contact us at [email protected]

Convert DOC to HTML using a REST API

With Doc Conversion API, you can convert easily between document formats, converting between Word DOC to HTML is a very important conversion for a number of reasons.


Conversion chart showing different types of conversions, highlighting Doc to HTML

It will allow you to turn an existing Word document into an HTML page, this will eliminate the risk of losing or editing any document content. With this conversion, you no longer need to worry about downloading documents and having them in a single location, you can access them from any device (mobile phones, tablets, computers), on any platform, with no extra software.

While there are a number of ways to convert a Word DOC to an HTML page, there has not been a single perfect method to do this both easily and efficiently, and without compromising on formatting or fidelity. But that’s where Doc Conversion API comes for the rescue, as it provides a very simple, reliable REST API that you can call into and execute with simple code, and quickly convert your Word Documents into fully formatted HTML pages.

Using the REST API to convert Doc to HTML (CURL)

Doc Conversion API is compatible with all programming languages and frameworks, you can find a list of code examples here.

You can simply convert from DOCto HTML by making a POST request, using the below URL Along with your APP credentials (Application ID and Secret Key):

https://api.docconversionapi.com/convert?outputFormat=html

To make the following curl request:

curl --request POST \
 --url 'https://api.docconversionapi.com/convert?outputFormat=html' \
 --header 'X-ApplicationID: <Your_Application_ID>' \
 --header 'X-SecretKey: <Your_Application_SecretKey>' \
 --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
 --form inputFile=undefined \
 --form optionsJSON=

Where:
X-ApplicationID
is your DCA Application ID

X-SecretKey      is your DCA Secret key

OutPutFormat is HTML

InputFile         is the file you would to like to convert

optionsJSON is a JSON String containing any additional options relevant to the conversion type.

Using the REST API to convert Doc to HTML (PHP)

Doc Conversion API is compatible with most programming languages and frameworks, you can find a list of code examples here.

For this PHP example, we’re using a direct URL for our word document (the document we’re converting) for simplicity, you can also upload documents to the service.

We’re going to be using this example:

http://homepages.inf.ed.ac.uk/neilb/TestWordDoc.doc

Example of the original test Doc to be converted to HTML

We’re going to create a simple PHP page that reads the Doc file from a URL, and converts this file into an HTML page:

PHP code to show how to use REST API to convert from Doc to HTMLDownload this page / View this page

This code will execute the conversion, and display the Word Doc content as an HTML page.

Output result from the Doc to HTML conversion

If you have any questions or need any further help, please contact us at [email protected]