Try the fastest and simplest way to install ONLYOFFICE

How to clear the header?

Integration questions/issues

How to clear the header?

Postby robertotomas » Fri Jan 05, 2018 3:44 pm

Using the api I currently can set the header with a call like:

Code: Select all
var oDocument = Api.GetDocument();
var oParagraph, oDrawing;
var oSection = oDocument.GetFinalSection();
oHeader = oSection.GetHeader("default", true);
oParagraph = oHeader.GetElement(0);
oDrawing = Api.CreateImage("https://www.newyorksightseeing.com/media/wysiwyg/GLNY/nyss_newyorkcity_roptimized.jpg.jpg", 60 * 36000, 35 * 36000);
oParagraph.AddDrawing(oDrawing)


This is great when I want to attach an image once there .., but when I want to replace what is in the header, how can I do that?

Similarly, I have a question about selections. Is it possible to select text, paragraph, etc? Or to move the cursor?
robertotomas
 
Posts: 26
Joined: Thu Aug 31, 2017 4:05 pm

Re: How to clear the header?

Postby Maxim » Tue Jan 09, 2018 7:42 am

Hello robertotomas!
I want to replace what is in the header, how can I do that?

It's not possible to replace an image for now, but it will be added later.
I have a question about selections

Selection will be added later too.
Or to move the cursor?

The cursor can be moved, but undocumented.
Maxim
 
Posts: 1747
Joined: Tue Oct 11, 2016 2:34 pm

Re: How to clear the header?

Postby robertotomas » Tue Jan 09, 2018 4:40 pm

Hmm, can I get the current paragraph (the paragraph the cursor is currently in)? How do I do it?
robertotomas
 
Posts: 26
Joined: Thu Aug 31, 2017 4:05 pm

Re: How to clear the header?

Postby Maxim » Wed Jan 10, 2018 7:26 am

Hello robertotomas!
can I get the current paragraph

No, there is no selection for now
Maxim
 
Posts: 1747
Joined: Tue Oct 11, 2016 2:34 pm


Return to API

Who is online

Users browsing this forum: No registered users and 1 guest