Remove File Metadata Using Ruby

Remove File Metadata Using Ruby

In this topic we are going to show you how to Remove File Metadata Using Ruby. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
require 'net/http'
require 'net/https'
require 'uri'
require 'json'

uri = URI.parse("https://api2.docconversionapi.com/api/jobs/create/metadata")

headers = { 
    'X-ApplicationID': 'Get your key from https://app.docconversionapi.com/#/applications',
    'X-SecretKey': 'Get your key from https://app.docconversionapi.com/#/applications'
}
form_data = {
    "inputFile" => "https://www.docconversionapi.com/samples/example.docx"
}

# Create the HTTP objects
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Post.new(uri.path, headers)
request.set_form form_data, 'multipart/form-data'

# Send the request
response = https.request(request)
puts response.body

 

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

Remove File Metadata Using Python

Remove File Metadata Using Python

In this topic we are going to show you how to Remove File Metadata Using Python. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
import requests

endpoint = "https://api2.docconversionapi.com/jobs/create/metadata"
headers = {
    'X-ApplicationID': 'Get your key from https://app.docconversionapi.com/#/applications',
    'X-SecretKey': 'Get your key from https://app.docconversionapi.com/#/applications'
}
data = {
    'inputFile': 'https://www.docconversionapi.com/samples/example.docx'
}

r = requests.post(url = endpoint, data = data, headers = headers)

response = r.text
print(response)

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

Remove File Metadata Using PHP

Remove File Metadata Using PHP

In this topic we are going to show you how to Remove File Metadata Using PHP. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
<?php
$url = 'https://api2.docconversionapi.com/jobs/create/metadata';
$fields = array(
    'inputFile' => 'https://www.docconversionapi.com/samples/example.docx'
);

//url-ify the data for the POST
foreach ($fields as $key => $value) {
    $fields_string .= $key . '=' . $value . '&';
}
$fields_string = rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'X-ApplicationID: Get your key from https://app.docconversionapi.com/#/applications',
    'X-SecretKey: Get your key from https://app.docconversionapi.com/#/applications'
));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);
print $result;

 

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

Remove File Metadata Using nodeJS

Remove File Metadata Using nodeJS

In this topic we are going to show you how to Remove File Metadata Using nodeJS. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
var request = require('request'),
    fs = require('fs'),
    https = require('https'),
    formData = {
    };


// Adding authentication headers
var headers = {
    'X-ApplicationID': 'Get your key from https://app.docconversionapi.com/#/applications',
    'X-SecretKey': 'Get your key from https://app.docconversionapi.com/#/applications'
};

// Result of this request is a JSON object which contains information about conversion
// including fileDownloadUrl that is used to get the resulting file
var conversionRequest = request.post({
    url: 'https://api2.docconversionapi.com/api/jobs/create/metadata',
    formData: formData,
    rejectUnauthorized: false,
    headers: headers,
    encoding: 'binary'
}, function (err, response) {
    
    var responseParsed = null;

    if (response.statusCode == 200) {

        // Parsing response JSON object and getting fileDownloadUrl value
        responseParsed = JSON.parse(response.body);
        console.log(responseParsed.fileDownloadUrl);

        // Downloading the file and writing it to the local folder
        const resultFile = fs.createWriteStream('output.pdf');
        https.get(responseParsed.fileDownloadUrl, function (response) {
            response.pipe(resultFile);
        });
    }
});

// Adding all parameters to multipart form
var form = conversionRequest.form();
form.append("inputFile", "https://www.docconversionapi.com/samples/example.docx");

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

Remove File Metadata Using jQuery

Remove File Metadata Using jQuery

In this topic we are going to show you how to Remove File Metadata Using jQuery. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
function sendPost() {
    var formData = new FormData();

    //Adding required parameters
    formData.append("inputFile", "http://test2.travelitinerary.net/wordtest2.cfm/?UUID=83D177DA-D374-4B04-BA6E-EB3772E937E3&PageSize=A4");

    var request = new XMLHttpRequest();
    request.open('POST', 'https://api2.docconversionapi.com/jobs/create/metadata', true);
    request.responseType = 'json';

    //Please, paste your AppId and SecretKey values here
    request.setRequestHeader("X-ApplicationID", 'Get your key from https://app.docconversionapi.com/#/applications');
    request.setRequestHeader("X-SecretKey", 'Get your key from https://app.docconversionapi.com/#/applications');

    request.onload = function () {
        if (request.status == 200) {
            console.log(request.response);
        }
    }

    request.send(formData);
}

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

Remove File Metadata Using Java

Remove File Metadata Using Java

In this topic we are going to show you how to Remove File Metadata Using Java. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

public class App 
{
    public static void main( String[] args )
    {
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("https://api2.docconversionapi.com/jobs/create/metadata");

        httppost.addHeader("X-ApplicationID", "Get your key from https://app.docconversionapi.com/#/applications");
        httppost.addHeader("X-SecretKey", "Get your key from https://app.docconversionapi.com/#/applications");

        MultipartEntity reqEntity = new MultipartEntity();
        reqEntity.addPart("inputFile", "https://www.docconversionapi.com/samples/example.docx");

        httppost.setEntity(reqEntity);

        HttpResponse response = httpclient.execute(httppost);
        System.out.println(response);

        HttpEntity resEntity = response.getEntity();
        System.out.println(resEntity);
        System.out.println(EntityUtils.toString(resEntity));

        EntityUtils.consume(resEntity);
        httpclient.getConnectionManager().shutdown();
    }
}

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

Remove File Metadata Using cURL

Remove File Metadata Using cURL

In this topic we are going to show you how to Remove File Metadata Using cURL. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
curl -H "Content-Type: multipart/form-data" -H "X-ApplicationID: Get your key from https://app.docconversionapi.com/#/applications" -H "X-SecretKey: Get your key from https://app.docconversionapi.com/#/applications" -F "inputFile=https://www.docconversionapi.com/samples/example.docx" -X POST "https://api2.docconversionapi.com/jobs/create/metadata"

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

Remove File Metadata Using C#

Remove File Metadata Using C#

In this topic we are going to show you how to Remove File Metadata Using C#. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile.

Request headers description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)

Annotation 2020-06-01 222907

Remove Metadata URL

https://api2.docconversionapi.com/jobs/create/metadata

Remove File Metadata example
using System;
using System.Globalization;
using System.IO;
using System.Net.Http;

namespace sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            using (HttpClient client = new HttpClient())
            {
                // Adding authentication headers
                client.DefaultRequestHeaders.Add("X-ApplicationID", "Get your key from https://app.docconversionapi.com/#/applications");
                client.DefaultRequestHeaders.Add("X-SecretKey", "Get your key from https://app.docconversionapi.com/#/applications");

                var inputFileUrl = "https://www.docconversionapi.com/samples/example.docx";

                using (var requestContent = new MultipartFormDataContent(
                    "Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture)
                    ))
                {
                    // Setting body parameters
                    requestContent.Add(new StringContent(inputFileUrl), "inputFile");

                    // Sending a POST request to DCA API
                    using (var requestResultTask = client.PostAsync(
                        "https://api2.docconversionapi.com/api/jobs/create/metadata", requestContent
                    ))
                    {
                        var requestResult = requestResultTask.Result;

                        if (requestResult.IsSuccessStatusCode)
                        {
                            Console.WriteLine([email protected]"This is a response JSON object where you can find fileDownloadUrl: {requestResult.Content.ReadAsStringAsync().Result}");
                        }
                        else
                        {
                            Console.WriteLine($"Error has occured! {requestResult.Content.ReadAsStringAsync().Result}");
                            Console.ReadKey();
                        }
                    }
                }
            }
        }
    }
}

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

Find And Replace Word File Content Using C#

Find And Replace Word File Content Using C#

In this topic we are going to show you how to Find And Replace Word File Content Using C#. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile, parameters and replacements.

Request parameters description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)
parameters JSON object that contains parameters like ‘matchCase’ and ‘matchWholeWord’
replacements Collection of search patterns and their replacements

Annotation 2020-05-21 095004

Find And Replace URL

https://api2.docconversionapi.com/jobs/create/find-and-replace

Find And Replace example (docx)
using System;
using System.Globalization;
using System.IO;
using System.Net.Http;

namespace sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            using (HttpClient client = new HttpClient())
            {
                // Adding authentication headers
                client.DefaultRequestHeaders.Add("X-ApplicationID", "Get your key from https://app.docconversionapi.com/#/applications");
                client.DefaultRequestHeaders.Add("X-SecretKey", "Get your key from https://app.docconversionapi.com/#/applications");

                var inputFileUrl = "https://www.docconversionapi.com/samples/example.docx";

                using (var requestContent = new MultipartFormDataContent(
                    "Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture)
                    ))
                {
                    // Setting body parameters
                    requestContent.Add(new StringContent(inputFileUrl), "inputFile");
                    requestContent.Add(new StringContent("{\"matchCase\": \"false\", \"matchWholeWord\": \"false\"}"), "parameters");
                    requestContent.Add(new StringContent("[{\"replacePattern\": \"Some Text\", replacement: \"Updated\"}]"), "replacements");

                    // Sending a POST request to DCA API
                    using (var requestResultTask = client.PostAsync(
                        "https://api2.docconversionapi.com/jobs/create/find-and-replace", requestContent
                    ))
                    {
                        var requestResult = requestResultTask.Result;

                        if (requestResult.IsSuccessStatusCode)
                        {
                            // Read your response file here
                        }
                        else
                        {
                            Console.WriteLine($"Error has occured! {requestResult.Content.ReadAsStringAsync().Result}");
                            Console.ReadKey();
                        }
                    }
                }
            }
        }
    }
}

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

Find And Replace Word File Content Using Ruby

Find And Replace Word File Content Using Ruby

In this topic we are going to show you how to Find And Replace Word File Content Using Ruby. We are going to use the following file as our input file:

https://www.docconversionapi.com/samples/example.docx

First we start a conversion job by making a POST request to the following URL and include these parameters into your request: inputFile, parameters and replacements.

Request parameters description:

X-ApplicationID Your application ID (which you get from your Doc Conversion API Account)
X-SecretKey Your secret key  (which you get from your Doc Conversion API Account)
parameters JSON object that contains parameters like ‘matchCase’ and ‘matchWholeWord’
replacements Collection of search patterns and their replacements

Annotation 2020-05-21 095004

Find And Replace URL

https://api2.docconversionapi.com/jobs/create/find-and-replace

Find And Replace example (docx)
require 'net/http'
require 'net/https'
require 'uri'
require 'json'

uri = URI.parse("https://api2.docconversionapi.com/jobs/create/find-and-replace")

headers = { 
    'X-ApplicationID': 'Get your key from https://app.docconversionapi.com/#/applications',
    'X-SecretKey': 'Get your key from https://app.docconversionapi.com/#/applications'
}
form_data = {
    "inputFile" => "https://www.docconversionapi.com/samples/example.docx",
    "parameters" => "{\"matchCase\": \"false\", \"matchWholeWord\": \"false\"}",
    "replacements" => "[{\"replacePattern\": \"Some Text\", replacement: \"Updated\"}]"
}

# Create the HTTP objects
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Post.new(uri.path, headers)
request.set_form form_data, 'multipart/form-data'

# Send the request
response = https.request(request)
puts response.body

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