Skip to content

How to retain URLs when calling document.SaveAs #14

@echarrod

Description

@echarrod

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions