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

Warning: You did not close a PDF Document. #97

Open
feiyuone opened this issue Jul 20, 2023 · 1 comment
Open

Warning: You did not close a PDF Document. #97

feiyuone opened this issue Jul 20, 2023 · 1 comment

Comments

@feiyuone
Copy link

When processing concurrently, you will receive a Warning: You did not close a PDF Document. May I ask, what is the situation? How to handle it?
I am using OracleJDK1.8.
the version docx4j-ImportXHTML is 8.3.8.
my code here:
`outputMLPackage = WordprocessingMLPackage.createPackage();

        outputMLPackage.getMainDocumentPart().addObject(this.getSectPr());

        importer = new XHTMLImporterImpl(outputMLPackage);

        
        InputStream is = this.getClass().getClassLoader().getResourceAsStream("data/cominfo.json");
        JSONArray jsonArray = JSON.parseArray(is);
        is.close();
        htmlBuilder = new HtmlBuilder();
        
        String content = htmlBuilder.build(jsonArray);
        jsonArray.clear();
        htmlBuilder = null;
        outputMLPackage.getMainDocumentPart().getContent().addAll(importer.convert(content,null));

        outputMLPackage.save(ops);
        ops.flush();
        ops.close();
        outputMLPackage.reset();`

thanks in advance

@hqudsi
Copy link

hqudsi commented Nov 11, 2024

Hi Team,
I'm also facing the same issue with version 8.3.11.
Any update?
Thanks

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

2 participants