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

How can i preserve pdf layout #1081

Open
pkbpawan opened this issue Nov 25, 2024 · 1 comment
Open

How can i preserve pdf layout #1081

pkbpawan opened this issue Nov 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@pkbpawan
Copy link

I have extract the content from PDF and translated the content in other language keep in json file same as a model generated json content file

Now I want to regenerate the same layout pdf again so how can i achive this.

is there any example please help me out

@pkbpawan pkbpawan added the enhancement New feature or request label Nov 25, 2024
@myhloli
Copy link
Collaborator

myhloli commented Nov 25, 2024

We don't have code for layout restoration. The current approach we can suggest is to use the page_idx/page_size information and bbox information of the corresponding block from the middle.json file. By utilizing PDF-related libraries such as PyMuPDF, create a blank PDF page and insert the content of the block into the corresponding page number and bounding box.

refer: https://github.com/opendatalab/MinerU/blob/master/docs/output_file_en_us.md#some_pdf_middlejson

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

No branches or pull requests

2 participants