Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use SVG Image in PDF using PdfRendererBuilder #945

Open
kiranduba opened this issue Sep 22, 2023 · 0 comments
Open

Unable to use SVG Image in PDF using PdfRendererBuilder #945

kiranduba opened this issue Sep 22, 2023 · 0 comments

Comments

@kiranduba
Copy link

kiranduba commented Sep 22, 2023

Im trying to add SVG image in HTML which will be later converted to HTML using PdfRendererBuilder class. But SVG image is not getting added in PDF.

Code :

    final PdfRendererBuilder builder = new PdfRendererBuilder();

    builder.withHtmlContent(content, null);
    builder.useSVGDrawer(new BatikSVGDrawer());

    try {
        builder.toStream(
                new FileOutputStream("C:\\Codebase\\spring\\pdf\\src\\main\\java\\pdfbox\\FinalSVG.pdf"));
        builder.run();
    } catch (final Exception e) {
        e.printStackTrace();
    }

HTML Code - is attached
Im using openhtmltopdf-pdfbox 1.0.5 & openhtmltopdf-svg-support 1.0.6 libraries.
Please any guidance would be of great help
testhtmlcode.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant