Skip to content

add support for -layout option#81

Open
Ravf95 wants to merge 1 commit intosajari:masterfrom
Ravf95:layout_option
Open

add support for -layout option#81
Ravf95 wants to merge 1 commit intosajari:masterfrom
Ravf95:layout_option

Conversation

@Ravf95
Copy link

@Ravf95 Ravf95 commented Mar 2, 2021

No description provided.

@Ravf95 Ravf95 changed the title added support for -layout option add support for -layout option Mar 2, 2021

// ConvertPages converts a Pages file to text.
func ConvertPages(r io.Reader) (string, map[string]string, error) {
func ConvertPages(r io.Reader, readability bool) (string, map[string]string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ravf95 this is a backwards incompatible change. Instead, we might have to explorer a solution like in my comment here: https://github.com/sajari/docconv/pull/75/files#r449309398

var body []byte
var err error
if readability {
body, err = exec.Command("pdftotext", "-q", "-nopgbrk", "-enc", "UTF-8", "-eol", "unix", "-layout", path, "-").Output()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd want to collapse the shared arguments into one location and pass in -layout if readability is true.

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

Successfully merging this pull request may close these issues.

2 participants