-
Notifications
You must be signed in to change notification settings - Fork 460
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
Unable to figure out how to set page margins on document #165
Comments
@srinathh I'll add this to my TODO to make a helper method, but for now you'll need to create the int64 yourself. Look at this // AddTabStop adds a tab stop to the paragraph.
func (p ParagraphStyleProperties) AddTabStop(position measurement.Distance, justificaton wml.ST_TabJc, leader w ml.ST_TabTlc) {
if p.x.Tabs == nil {
p.x.Tabs = wml.NewCT_Tabs()
}
tab := wml.NewCT_TabStop()
tab.LeaderAttr = leader
tab.ValAttr = justificaton
tab.PosAttr.Int64 = gooxml.Int64(int64(position / measurement.Twips))
p.x.Tabs.Tab = append(p.x.Tabs.Tab, tab)
} |
srinathh
added a commit
to srinathh/gooxml
that referenced
this issue
Mar 2, 2018
Thanks! I've created a helper function to set margins based on your code & sent a pull request. |
Great, thanks! I'll merge it soon. |
tbaliance
pushed a commit
that referenced
this issue
Mar 3, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I am unable to figure out how to set page margins on document. I would like to set margins of the generated document to 0.5 inch
I managed to follow the rabbit hole of XML down to
doc.X().Body.SectPr.PgMar.TopAttr
but then there's a pointer to an int64 which i'm not able to set. When I try to retrieve the object, I get a null pointer error.The text was updated successfully, but these errors were encountered: