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 to retain URLs when calling document.SaveAs #14

Open
echarrod opened this issue Mar 23, 2021 · 0 comments
Open

How to retain URLs when calling document.SaveAs #14

echarrod opened this issue Mar 23, 2021 · 0 comments

Comments

@echarrod
Copy link

When I use document.SaveAs with "pdf" as the extension (and a .docx as the input file), the URL links are stripped:

// SaveAs saves document at desired path in desired format with applied filter rules
// Actual (from libreoffice) error message can be read with Office.GetError
func (document *Document) SaveAs(path string, format string, filter string) error {
	cPath := C.CString(path)
	defer C.free(unsafe.Pointer(cPath))
	cFormat := C.CString(format)
	defer C.free(unsafe.Pointer(cFormat))
	cFilter := C.CString(filter)
	defer C.free(unsafe.Pointer(cFilter))
	status := C.document_save(document.handle, cPath, cFormat, cFilter)
	if status != 1 {
		return fmt.Errorf("Failed to save document")
	}
	return nil
}

Is it possible to retain these with a filter option?

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