PhpAbbyy is an integration library for the file conversion functionality of Abbyy finereader server.
You will need to install ZipArchive or any dependencies. For Docker that looks like the following.
RUN apt-get install -y \
libzip-dev \
zip \
&& docker-php-ext-install zip
PhpAbbyy can be installed to your project via Composer by adding the following line to your composer.json file:
"cidilabs/phpabbyy": "dev-master"
Once Phpabbyy library is installed, you'll need to let UDOIT know which file conversion library you'll be using.
This can be done:
- In the .env:
###> file formats ### AVAILABLE_FILE_FORMATS="html,pdf"
You will also need to define the Abbyy Fineserver endpoint.
##ABBYY domain to point to for REST API
ABBYY_DOMAIN="http://example:8080"
- fileName: The name of the file
- fileUrl: The download URL for the file
- fileType: The file type of the original file
- format: The file type that we want to convert to
$abbyy = new PhpAbbyy();
$fileUrl = "https://cidilabs.instructure.com/files/295964/download?download_frd=1&verifier=RZwKCP3iVlNQIULZnTAXO0usUROMC9AuplKkDf2g";
$options = array('fileUrl' => $fileUrl, 'fileType' => 'pdf', 'format' => 'html', 'fileName' => 'Test1.pdf');
$abbyy->convertFile($options);
- options: (array) -- fileName: (string) The name of the file -- fileUrl: (string) The download URL for the file -- fileType: (string) The file type of the original file -- format: (string) The file type that we want to convert to
- taskId: (string) The UUID representing the file conversion task
- null
- taskId: (string) The UUID representing the file conversion task
- True/False (boolean) True if the file has been converted and is ready, false otherwise
- taskId: (string) The UUID representing the file conversion task
- fileUrl: (string) The url of the converted file
- null
- fileUrl: (string) The url of the converted file
- fileUrl: (string) The url of the converted file
- True/False (boolean) True if successfully deleted, false otherwise
- filePath: (string) File path to Zip file to unzip
- fileNames: (string) File names from extracted Zip
- fileString: (string) Name of file
- fileNames: (string) returns file ending from file name
- jobId: (string) Job ID of task
- True/False (boolean) True if the request was completed