Certain PDF files that I import, after the text/curves and font substitution dialogs fail to import due to a "The file is corrupted." error:
I don't have much hope that the issue will be corrected in the source application so I'm hoping there may be some possibility of Corel fixing this. I had hoped it would be fixed in X7 but it wasn't.
I've included an example at this link:
https://www.dropbox.com/sh/vkbz9j97njtm1ct/AAD13tCkHPoU-1Ui5-Etwz-Ja
The original file can't be imported into CorelDraw but works fine in every other application I've tried it in such as Adobe Acrobat, Firefox and Chrome (using their native PDF readers), Windows 8.1 preview app, Android PDF readers, etc.
While it's likely there is something non-standard in the original file, CorelDraw is the only application to make a fuss about it and clearly there is enough information in there for proper rendering so I just need CorelDraw to ignore whatever error it's encountering.
I've found that loading and re-saving such files in Acrobat Pro does not fix them - they still cannot be imported. However, if I load them in Acrobat Pro and save using the "Optimize" option, the resulting PDF can be imported without error. Examples of these 2 re-saved files are included in the link above.
While the save Optimized is a suitable workaround, I sometimes have to work with many such files at the same time and since there does not appear to be any way to automate or run through the command line the save Optimized procedure in Acrobat I have to do so for each file individually which is slow and tedious. I'd love to see this issue fixed in CorelDraw.
I also wonder if there is any way to make font substitution choices persistent so that they are automatically applied without confirmation through a dialog every time I import a PDF. Similarly for the text/curves dialog. There are very few cases were I'd want to import text as curves so I'd much rather be able to set a default and have PDF files imported without interaction with an option somewhere to restore the dialogs when I need them. Again, for a few imports this is not a big deal but when I have to import many it would save me much time and frustration if I could just drag a stack of files to CorelDraw and have them all import automatically without pestering me further.
Thanks.
Thanks for the update.
I'm willing to cut Corel some slack ;), particularly if they fix other more pressing issues like high dpi support (now that I have a Surface Pro 3).
While Corel can't be expected to support non-spec files, as I noted in my original post, every other app I've tried has no issues with these files so it does appear to be a case of Corel being overly conservative about the standard or perhaps they're just performing additional checks that other apps are not bothering to check, but that don't actually cause any problems in this case. Perhaps this is a good thing that prevents truly corrupt or even malicious pdfs from crashing CorelDraw or causing other problems. It's a pain for me but not a dealbreaker as resaving the file or using ghostscript as an intermediary for batch jobs are reasonable workarounds.
Magriite said:using ghostscript as an intermediary for batch jobs are reasonable workarounds.
How do you do that?
The PDF files I was having issues with were produced using R (which is a statistics programming language). In R there are various output options. I had discovered, I could output to a postscript file rather than a PDF. So you would have to have a similar option in whatever source program you're using to generate your PDF. The postscript file can be imported directly into CorelDraw or converted to a compliant PDF using ghostscript. I haven't done this in a long time but there appears to be a script (ps2pdf.bat) that makes it easy to convert a ps (postscript file) to a pdf. This is part of ghostscript.
That being said, I haven't had this issue personally in a long time. I used to use CorelDraw to do some preprocessing of figures that would usually end up in a powerpoint presentation. Powerpoint is terrible at importing just about anything so the most effective way I had found was to output to pdf, import to CorelDraw, adjust as necessary, then copy and paste as a windows metafile into powerpoint.
Since then, I've learned how to export directly to an editable powerpoint and better format from with R, so I now avoid the whole process. When I got an alert that there were new replies in this thread, I downloaded the original test files from my dropbox link but did not get any errors.
I've since upgraded to X8 from X7. So perhaps X8 or one of the updates since has fixed this issue? If you're using X7 or older and would consider upgrading, you can download a trial of the newest version and see if that fixes your import issues.
Otherwise, see if your originating program can output in a different format like postscript or you'll have to use Acrobat Pro, Corel Fusion or something else to do some processing of the pdf files to make them compatible, as previously described in this thread.
Thank you for replying.
I tried Fusion, but it took a long long time to export/import the file and it still didn't look too good. It's a wonder why Corel Fusion and open the original pdf file, but CorelDraw can't (like you noted)?
I have Acrobat XI, but not Pro, and it doesn't help.
I'm using Trimble/Sketchup/Layout to produce the pdf files and there's no option for ps export.
Maybe one can export a pdf to ps and then back into CorelDraw?
I had the same problem in CorelDraw X6 and Windows 8.1. I recently bought a new computer with Windows 10 and CorelDraw 2018 hoping that the problem would be solved. I wonder if CorelDraw 2019 is any better?
How does one use ghostscript as an intermediary for batch jobs are reasonable workarounds?
I don't use ghostscript much so I can't really help you off the top of my head. I suggest you do some reading on it. It may be possible to use it to read a pdf file and reprint it, which may potentially fix the problem. I vaguely recall trying something like that but can't remember if it worked or not. If so, it may be possible to write a small batch file to automate this for a folder's worth of pdf files.
Another thing you could try is open the pdf in acrobat reader, then print it using Windows built in pdf writer. This should be installed by default in Windows 10 and the virtual printer is called "Microsoft Print to PDF". Can't recall if this was available in Windows 7. I believe ghostscript has an option for a virtual printer too, so this may be another option.
If this approach works it should be okay if you're dealing with a relatively small number of files.
djh said:How does one use ghostscript as an intermediary for batch jobs are reasonable workarounds?
In my case, I was referring to outputting from R to ps files then using ps2pdf.bat from ghostscript to convert those to pdfs. Since R can call system commands, I could actually script outputting to a ps file, conversion through ps2pdf.bat then deletion of the intermediary ps file as part of the R script. I don't know if you have any scripting options in the apps you use that would help.
I was just looking at my ghostscript folder where ps2pdf.bat is located (it's under ghostscript/bat) and there are a number of other batch files in there, including one called pdf2ps.bat. So it's possible you could convert your pdfs to ps files using pdf2ps.bat then convert then back into pdf files using ps2pdf.bat. Perhaps in this process, ghostscript will fix whatever meta data issues are causing the files to fail to import.
1) Import the PDF file in Inkscape. 2) Save it as a PDF file in Inkscape. 3) Import the PDF file into CDR worked.
Try Free PDF Compressor (http://www.freepdfcompressor.com/) and then import the PDF into CDR.