Git Product home page Git Product logo

Comments (2)

dothinking avatar dothinking commented on August 12, 2024

在第一个版本0.0.1中考虑过这个自动换行问题:对于PDF中提取出来的空间上的两行,如果当前行理论剩余空间不足以容纳下一行的第一个字符,表明Word中可以自动换行,于是省略这两行之间的换行符(Shift+Enter),也就是你图片中行尾的符号。

然而现实问题是上面计算的理论距离是基于PDF提取的数据,而在Word中渲染后可能是不同的值,导致实际判断换不换行有时正确有时失败。所以,后续版本取消了这个判断,统一用换行符处理。

这样处理达到了“看起来像”的效果,不过语义上确实有割裂,但好在换行符(Shift+Enter)不同于回车(Enter),这两行在Word中仍属于同一个段落。后续如果有文本处理上的需求,可以在提取段落内容后再过滤一遍\n

如果有了新的想法,我会继续考虑这个自动换行的问题。

from pdf2docx.

smilelight avatar smilelight commented on August 12, 2024

好的,感谢您的耐心回复~

from pdf2docx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.