diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-09-12 19:05:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 19:05:05 (GMT) |
commit | 4fbb61f020a607a96152ba5c00668b9840ea812c (patch) | |
tree | 54807f517f9e72ab5fe813404a8b361d92062f52 /src | |
parent | ec86b8878c23c7ff4024c365afefb8b14311596e (diff) | |
parent | 54288872a1eb5c36a5d8b6fbcc9cafb1f38cefad (diff) | |
download | Doxygen-4fbb61f020a607a96152ba5c00668b9840ea812c.zip Doxygen-4fbb61f020a607a96152ba5c00668b9840ea812c.tar.gz Doxygen-4fbb61f020a607a96152ba5c00668b9840ea812c.tar.bz2 |
Merge pull request #7251 from albert-github/feature/bug_674005
Bug 674005 - Crop png formula environnment problem for HTML output
Diffstat (limited to 'src')
-rw-r--r-- | src/formula.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/formula.cpp b/src/formula.cpp index 1c5042e..534f56a 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -118,11 +118,12 @@ void FormulaList::generateBitmaps(const char *path) int pageNum=*pagePtr; msg("Generating image form_%d.png for formula\n",pageNum); char dviArgs[4096]; + char psArgs[4096]; QCString formBase; formBase.sprintf("_form%d",pageNum); // run dvips to convert the page with number pageIndex to an - // encapsulated postscript. - sprintf(dviArgs,"-q -D 600 -E -n 1 -p %d -o %s.eps _formulas.dvi", + // postscript file. + sprintf(dviArgs,"-q -D 600 -n 1 -p %d -o %s_tmp.ps _formulas.dvi", pageIndex,formBase.data()); portable_sysTimerStart(); if (portable_system("dvips",dviArgs)!=0) @@ -133,6 +134,18 @@ void FormulaList::generateBitmaps(const char *path) return; } portable_sysTimerStop(); + // run ps2epsi to convert to an encapsulated postscript file with + // boundingbox (dvips with -E has some problems here). + sprintf(psArgs,"%s_tmp.ps %s.eps",formBase.data(),formBase.data()); + portable_sysTimerStart(); + if (portable_system("ps2epsi",psArgs)!=0) + { + err("Problems running ps2epsi. Check your installation!\n"); + portable_sysTimerStop(); + QDir::setCurrent(oldDir); + return; + } + portable_sysTimerStop(); // now we read the generated postscript file to extract the bounding box QFileInfo fi(formBase+".eps"); if (fi.exists()) @@ -282,6 +295,7 @@ void FormulaList::generateBitmaps(const char *path) f.close(); } // remove intermediate image files + thisDir.remove(formBase+"_tmp.ps"); thisDir.remove(formBase+".eps"); thisDir.remove(formBase+".pnm"); thisDir.remove(formBase+".ps"); |