Prizm Content Connect
Converting Content with CCS

This section provides steps for converting content with CCS.

Step 1: Upload Your Source Document

Example:

POST http://192.168.0.1:18681/PCCIS/V1/WorkFile?FileExtension=doc
Content-Type: application/octet-stream
[binary data]

200 OK
Content-Type: application/json
{
    "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
}

Step 2: Start the Content Conversion Process

Example:

POST http://192.168.0.1:18681/v2/contentConverters
Content-Type: application/json
{
    "input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg"
            }
        ],
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": true
            }
        }
    }
}

200 OK
Content-Type: application/json
{
    "processId": "bQpcuixhvGmNqn5ElskO6Q",
    "expirationDateTime": "2014-12-03T18:30:49.460Z",
    "input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
                "pages": ""
            }
        ],
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": true
            }
        }
    },
    "state": "processing",
    "percentComplete": 0
}

Step 3: Check Status of the ContentConverter Resource

Example:

GET http://192.168.0.1:18681/v2/contentConverters/bQpcuixhvGmNqn5ElskO6Q

200 OK
Content-Type: application/json
{
    "processId": " bQpcuixhvGmNqn5ElskO6Q ",
    "expirationDateTime": "2014-12-03T18:30:49.460Z",
    "input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
                "pages": ""
            }
        ],            
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": true
            }
        }
    },
    "state": "complete",
    "percentComplete": 100,
    "output": {
        "results": [
            {
                "fileId": "ek5Zb123oYHSUEVx1bUrVQ",
                "sources": [
                    {
                        "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
                        "pages": "1"
                    }
                ]
            },
            {
                "fileId": "KOrSwaqsguevJ97BdmUbXi",
                "sources": [
                    {
                        "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
                        "pages": "2"
                    }
                ]
            },
            {
                "fileId": "o349chskqw93kwaqsgfevJ",
                "sources": [
                    {
                        "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
                        "pages": "3"
                    }
                ]
            }
        ]
    }
}

Step 4: Download the Converted Document(s)

Example:

GET http://192.168.0.1:18681/PCCIS/V1/WorkFile/ek5Zb123oYHSUEVx1bUrVQ

200 OK
Content-Type: application/pdf
[binary data]

Conversion Input Examples

Below are example JSON strings that can be used as input in Step 2 above to create various ContentCoverter processes.

Multipage Word Document to Multipage PDF

This example will convert all pages of a Word document to a single PDF document:

"input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg"
            }
        ],
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": false
            }
        }
}

Single-page Word Document to Scaled PNG

This will convert a single page Word Document to a PNG image, scaled to 800 pixels width. Height will adjust automatically to maintain aspect ratio:

"input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg"
            }
        ],
        "dest": {
            "format": "png",
            "pngOptions": {
                "maxWidth": "800px"
            }
        }
}

Multipage Word Document to Multiple PNG Images

This will convert a multipage Word Document to multiple, single page PNG images. As PNG is not a multipage format, each page of the Word Document will be converted to a separate PNG:

"input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg"
            }
        ],
        "dest": {
            "format": "png"
        }
}

JPEG to PNG

This example will convert a JPEG image to a PNG image, scaled to fit within 800 pixels width and 600 pixels height. The output PNG will be as large as it can be while maintaining aspect ratio and remaining within these bounds:

"input": {
        "sources": [
            { 
                "fileId": "5qTYa3gzN9gYUb5SzqUhqg"
            }
        ],
        "dest": {
            "format": "png",
            "pngOptions": {
                "maxWidth": "800px",
                "maxHeight": "600px"
            }
        }
}

Specific Pages of Two Multipage Documents to Multipage TIFF

This example will merge first page of a Word document with the second and third pages of a PDF document and convert them to a single TIFF document:

"input": {
    "sources": [
        {
            "fileId": "drxx_2sNVu9VIZTS4VH2Dg",
            "pages": "1"
        },
        {
            "fileId": "qkMQmjk6CxSzt5UEY-UdFQ",
            "pages": "2-3"
        }
    ],
    "dest": {
        "format": "tiff"
    }
}

All Pages of Three Multipage Documents to Multipage PDF

This example will merge together all pages of the first PDF document with all pages of the second Word document and all pages of the third TIFF document and convert them to a single PDF document.

"input": {
    "sources": [
        {
            "fileId": "TP4TX_SxCNF86suTfHHFSw"
        },
        {
            "fileId": "oJo8CWXAgFJ0dns8UF_AzQ"
        },
        {
            "fileId": "EYsfBhL0JbYgNk80sbnxEg"
        }
    ],
    "dest": {
        "format": "pdf"
    }
}

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback