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

SetHeader Function Change Word Line Spacing #524

Open
yeezyi opened this issue Oct 22, 2024 · 3 comments
Open

SetHeader Function Change Word Line Spacing #524

yeezyi opened this issue Oct 22, 2024 · 3 comments

Comments

@yeezyi
Copy link

yeezyi commented Oct 22, 2024

Description

after use SetHeader Func, The Paragraph LineSpacing was be changed, the verticalAlignment of Paragraph change to top

Expected Behavior

image

Actual Behavior

image

Please include a reproducible code snippet or document attachment that
demonstrates the issue.

func main() {
	doc := document.New()
	defer doc.Close()

	img, err := common.ImageFromFile("gophercolor.png")
	if err != nil {
		log.Fatalf("unable to create image: %s", err)
	}

	hdr := doc.AddHeader()
	iref, err := hdr.AddImage(img)
	if err != nil {
		log.Fatalf("unable to to add image to document: %s", err)
	}

	para := hdr.AddParagraph()

	imgInl, _ := para.AddRun().AddDrawingInline(iref)
	imgInl.SetSize(1*measurement.Inch, 1*measurement.Inch)

        // -----the only different is use or not the follow line code -----
	// doc.BodySection().SetHeader(hdr, wml.ST_HdrFtrDefault)


	text := `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin lobortis, lectus dictum feugiat tempus, sem neque finibus enim, sed eleifend sem nunc ac diam. Vestibulum tempus sagittis elementum`

	para = doc.AddParagraph()
	para.SetLineSpacing(30, wml.ST_LineSpacingRuleAuto)
	
	run := para.AddRun()
	run.Properties().SetSize(18)
	run.AddText(text)

	para.Properties().VerticalAlignment()

	doc.SaveToFile("header-footer.docx")
}
Copy link

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized,
other issues go into our backlog where they are assessed and fitted into the roadmap when suitable.
If you need to get this done, consider buying a license which also enables you to use it in your commercial products.
More information can be found on https://unidoc.io/

@ipod4g
Copy link

ipod4g commented Oct 30, 2024

@yeezyi Thank you for reaching out about this issue. We'll review it and provide an update soon.

@anovik
Copy link

anovik commented Nov 12, 2024

@yeezyi I've tested both cases (with header and without header) with the latest UniOffice version (v.1.37.0) and behavior is the same, line spacing and alignment are the same for these two cases.

Could you please make sure you are using the latest version of UniOffice?

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

3 participants