I've been trying to convert some PDF files to plucker but I can't make
the equations look fine.

First I tried with pdftohtml, the resulting html looks fine but when I
pass it trougth distiller the formulas are lost. Then I tried with
pdftopnm to generate static images but since I have a m130 the images
won't look fine and plucker crashes when I try to load an image bigger
than 320x320 pixels (I have to press the reset button every time I try
that). Finally I tried with pstoedit converting the pdf to latex code,
but the generated code are plain figures so when I pass it trought
latex2html all I get are bitmaps so It's the same problem as with
pdftopnm.

Has someone solved this problem? Is there a free tool to convert pdf
files to plucker format without loosing the math formulas and the text
floating inside images?

I guess the best solution is to convert the pdf to latex but instead
of latex figures put the plain text, the equations in displaymath
environments and the graps in figure environments, so latex2html will
generate pngs for the formulas and graphs and leave the text as plain
html text.

Here is the code:

Using pdftohml:
-----------------------------------------------------------
#!/bin/bash

# Configuracion:
MAXWIDTH=480
MAXHEIGHT=10000
DEPTH=100
# Fin configuracion

if [ $# -lt 2 ]
    then
    echo "Modo de uso:"
    echo "$0 PDF NOMBRE_DOC"
    exit 1
fi

PDF=$1
DOC_NAME=$2

pdftohtml -c  $PDF ${DOC_NAME}.html
if [ $? != 0 ]
    then
    echo "Error convirtiendo a html"
    exit 2
fi

plucker-build --alt-maxheight=$MAXHEIGHT --alt-maxwidth=$MAXWIDTH --bpp=16 \
    --maxwidth=150 --maxheight=150 --zlib-compression \
    --doc-file=$DOC_NAME --doc-name=$DOC_NAME --title=$DOC_NAME -p $PWD\
    --maxdepth=$DEPTH --staybelow=file: \
    -V 1 file://${PWD}/${DOC_NAME}_ind.html

----------------------------------------------------------------------------------

Using pdftoppm:
------------------------------------------------------------------------------------
#!/bin/bash

# Configuracion:
MAXWIDTH=320
MAXHEIGHT=1000
DEPTH=100
# Fin configuracion

if [ $# -lt 2 ]
    then
    echo "Modo de uso:"
    echo "$0 PDF NOMBRE_DOC"
    exit 1
fi

PDF=$1
DOC_NAME=$2

pdftoppm -t1lib yes -freetype yes -aa yes -gray -r 75 $PDF $DOC_NAME

for i in ${DOC_NAME}*.pgm
  do
  NN=$(basename $i .pgm)
  ppmtojpeg --optimize $i > ${NN}.jpg
done

rm -f ${DOC_NAME}*.pgm

echo "<html><head></head><body>" > ${DOC_NAME}_ind.html
for i in ${DOC_NAME}*.jpg
  do
  echo "<img src=\"$i\"></img><br></br>" >> ${DOC_NAME}_ind.html
done
echo "</body></html>" >> ${DOC_NAME}_ind.html

plucker-build --alt-maxheight=$MAXHEIGHT --alt-maxwidth=$MAXWIDTH --bpp=16 \
    --maxwidth=150 --maxheight=150 --zlib-compression \
    --doc-file=$DOC_NAME --doc-name=$DOC_NAME --title=$DOC_NAME -p $PWD\
    --maxdepth=$DEPTH --staybelow=file: \
    -V 1 file://${PWD}/${DOC_NAME}_ind.html

------------------------------------------------------------------------------------

And please act as it if that code has the GNU GPL stuff in the head :)


-- 
Jaime Alberto Silva Colorado
_______________________________________________
plucker-list mailing list
[email protected]
http://lists.rubberchicken.org/mailman/listinfo/plucker-list

Reply via email to