coolwanglu / pdf2htmlEX

Convert PDF to HTML without losing text or format.
http://coolwanglu.github.com/pdf2htmlEX/
Other
10.34k stars 1.84k forks source link

Not an issue: Is anyone willing to help me !! #749

Open AvdiuAndin opened 6 years ago

AvdiuAndin commented 6 years ago

I have downloaded pdf2htmlex ( http://soft.rubypdf.com/software/pdf2htmlex-windows-version ) for windows and https://www.npmjs.com/package/pdftohtmljs this package to use it for my application. When i try to convert a pdf from my node app, i get this message on my console. (percentages are just the progress number of converting the file ) 0 % 20 % 40 % 60 % 80 % 100 % { code: 1, signal: null } The file html is generated but there is nothing on it. I got stuck here and cannot find the solution.

point to mention: I can convert a pdf file when i go to the directory of pdf2htmlex and run on cmd the command pdf2htmlex x.pdf, but when i go to other directories i get this message Preprocessing: 2/2 Working: 2/2 Error: Cannot open the manifest file

i see 'cannot open the manifest file' problem reported here also https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ but i'm on windows !!

hkajcy commented 6 years ago
    // apply manifest
    ifstream manifest_fin((char*)str_fmt("%s/%s", param.data_dir.c_str(), MANIFEST_FILENAME.c_str()), ifstream::binary);
    if(!manifest_fin)
        throw "Cannot open the manifest file";
wduville commented 6 years ago

What hkajcy means is that, in this case, you have to add the " --data-dir [folder]" option to point to the data folder that is provided in the zip file.

pdf2htmlex --data-dir C:\mbin\data file.pdf out.html