Wondershare PDF to Word Converter has been designed to be the best tool for PDF conversions, eliminating the need to rewrite or copy and paste from one document format to another. Key features include: Convert PDF to Word. Preserve the original PDF text, images, and graphics in the output documents. Simple User interface.
It is possible to create pdf in PDF/X-1a or PDF/X-4 format, create a multi-page pdf, resize and rotate each image, convert each image to grayscale, and set trim and bleed size to each page of pdf, for free. Convert a file to PDF online for free with Adobe Acrobat online services. Use the PDF converter tool to easily transform various file formats.
Question: How can I convert PDF files from version 1.1 to 1.4 (or higher)? Actually I need some sort of command line tool for batch converting or some API to be able to convert dynamically sever all documents.
Answer:PDF 1.1 is forward compatible with PDF 1.4. Everything in PDF 1.1 will work with PDF 1.4 - it's guaranteed by the spec. Let's assume that you've got some justifiable reason why this is not good enough for you (let's assume, for example, that you have a non-spec compliant tool that consumes PDF and explodes on any file version less that 1.4).We can focus on the main syntactic differences between versions. All PDF files have a header somewhere in the first 1024 bytes. In most cases, it's the very first line, but that's not guaranteed (I'm looking at you Ghost Script!). The header looks like this in PDF 1.1: %PDF-1.1 In PDF 1.4,
it looks like this: %PDF-1.4 So in theory, all you need is a tool that will look in the first 1024 bytes for a file for '%PDF-1.1' and change it to '%PDF-1.4'. You could use sed, perl, etc to do something like that for you. You could write it in C and you would be tempted to do something like this:
#define PDFHEADERSIZE 1024
bool ChangeFileToNewPdfVersion(char *file)
{
char *replacePoint = NULL;
FILE *fp = fopen(file, 'rw');
char buf[PDFHEADERSIZE + 1];
buf[PDFHEADERSIZE] = '0';
if (fread(buf, 1, PDFHEADERSIZE, fp) != PDFHEADERSIZE) { fclose(fp); return false; }
fseek(fp, 0, SEEK_SET);
if ((replacePoint = strstr(buf, '%PDF-1.1')) NULL) { fclose(fp); return false; }
replacePoint[7] = '4';
if (fwrite(buf, 1, PDFHEADERSIZE, fp) != PDFHEADERSIZE) { fclose(fp); return false; }
fflush(fp);
fclose(fp);
return;
}
which will work in most sane cases. It will not work if the file starts, for example, with 0 bytes, which would serve as null terminators in the block of data. A better choice (really) would be to cobble up a simple state machine to find %PDF-1. by reading 1 byte at a time until it either finds it or passes 1017 (1024 less the header length), then reads the next byte, if it's a '1', it seeks back a byte and writes a '4'. The only other thing you would need to worry about is that PDF 1.4 suggests that the document catalog should contain a Version key with the file version. Since this is defined as optional in the spec, you are
safe to ignore it. Actually if you feel this is a little complicated, you can use software VeryPDFPDF Editor can help you change PDF version directly through software interface. Please check details from the following snapshot.
If you need to use the command line version, please choose the PDF Editor OCX Control (ActiveX). During the using, if you have any question, please contact us as soon as possible.