1. petermr
  2. pdf2svg
  3. Issues
Issue #9 resolved

REQ REQUEST: Dependency issue between PDFPage2SVGConverter and PDF2SVGConverter

foxty foxty
created an issue

You guys did a great job and this is what i really want, but have some small issues and thoughts as below:

I thought its may better to let PDFPage2SVGConverter not relay on PDF2SVGConverter. Since PDF2SVGConverter is the parent of PDFPage2SVGConverter and the page converter only relay on some static resources.

E.g. for my case, I may only want to embed the PDFPage2SVGConverter into my project but not to use the command line style of PDF2SVGConverter which even generate some html pages that I don't need.

Thanks so much, Isaac

Comments (7)

  1. petermr repo owner

    Thanks very much Isaac.

    I am guessing that your problems are resolved.

    You guys did a great job

    Please feel that you and any others are equal members of a project. My style is to help build communities and - overall - AMI2 is a project which we hope anyone can benefit from and contribute to. pdf2svg is certainly usable asis and the main enhancements will be dealing with horrible fonts.

    and this is what i really want, but have some small issues and thoughts as below:

    I thought its may better to let PDFPage2SVGConverter relay on PDF2SVGConverter. Since PDF2SVGConverter is the parent of PDFPage2SVGConverter and the page converter only relay on some static resources.

    E.g. for my case, I may only want to embed the PDFPage2SVGConverter into my project but not to use the command line style of PDF2SVGConverter which even generate some html pages that I don't need.

    I have now linked PDF2SVG into SVGPlus and the interface is very much what you want:

    public List<SVGSVG> createSVGPageList(File infile) {
        ensurePDF2SVGConverter();
        pdf2svgConverter.run(infile.getAbsolutePath());
        return pdf2svgConverter.getPageList();
    }
    

    You can do this at present.

    The main problem is that we may was to configure PDDF2SVG - "use these font resources" - "convert these characters to Unicode" - "set debug level and collect output for analysis".

    If you are dealing with PDFs from a single source then I think you can do exactly what you want - just call it as above.

    Your involvement is very helpful to us.

  2. petermr repo owner

    I think the easiest way is to make silent conversion the default and to make everything else happen through commandline flags or setters.Thus

    public List<SVGSVG> createSVGPageList(File infile) { ensurePDF2SVGConverter(); pdf2svgConverter.run(infile.getAbsolutePath()); return pdf2svgConverter.getPageList(); }

    should produce almost no output and simply a list of pages in memory. We then have switches like:

    -html <menu>

    List<AmiFont> getListOfFonts();

    etc.

    There also needs to be a set of properties to limit the debug from PDFBox (we include log4j.properties in the tree).

  3. foxty foxty reporter

    I found the flag -nosvg is always set writeFile = true; This may avoid write files (including HTML file) to disk and then i can handle the SVGs via getPageList();

  4. Log in to comment