Free Support Forum - aspose.com

How to skip a line in the footer

Hi,

This seems so simple, yet I haven't find a way to move the cursor to the next line before writing. Could you please help? Thanks in advance!

In my word file, I have a footer that I would like to look like this:

Auto-populate numbering of page (using MS)
[would like to insert footer text on this line]
Testing blah blah

.NET code
builder.MoveToHeaderFooter(Aspose.Words.HeaderFooterType.FooterPrimary)
builder.Writeln(footertext)

Currently this is how it comes out:
[footertext]
Auto-populate numbering of page (using MS)
Testing blah blah

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Maybe you should use Documentbuilder.Write method instead of DocumentBuilder.Writeln.

builder.Write(footertext)

Best regards.

Hi Alexey,

I tried as you suggested but it gave the same result. Maybe if I explain a bit more of what I need to do you would be know what I need. I have some text that are all in the footer in the word template. I need to insert a dynamically generated text in the footer but after the first line of text already there in the footer from the word template. Somehow once aspose.word move to the footer section, tell it to skip a line(because some text is already there) and start writing the dynamic text in the next line.

Is is possible? Thanks so much!

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your explanation. Could you please attach your document? I will investigate the problem and provide you a solution. In addition, it would be useful, if you attach the expected output.

Best regards.

Hi Alexey,

I figured a work-around for my problem. Thanks so much for your time. I'll just do it my work around way for now. Thanks again!

I am trying to do something similar. Could you please share your work around?

Thanks, North

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you please describe your situation and attach sample documents(result and expected result) and code here? Maybe I will be able to provide you a solution.

Best regards.

Thanks Alexey!

Below is the link with the details: http://www.aspose.com/community/forums/permalink/230576/230576/showthread.aspx#230576

Thanks,

North

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I just answered your request here:

http://www.aspose.com/community/forums/thread/230596/line-spacing-in-paragraphs.aspx

Please let me know in case of any issues.

Best regards.

Alexey,

Thanks for your response. The link posted above is for setting line spacing in a paragraph. My requirement is somewhat different. I still went ahead and tried it out and with the same result.

I need to append new text on a new line to the end of any pre-existing content in the primary footer in a document.

I have the code below that allows me to add the text but to a new line at the top of the footer.

//=========================================
Aspose.Words.Document doc= new Aspose.Words.Document("C:\\Templates\\test.doc");

Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);

Font font = builder.Font;
font.Color = System.Drawing.Color.Black;
font.Name = "Arial";
font.Size = 8;

builder.Writeln("Footer text");

//=========================================

Thanks, North

Hi

Thank you for additional information. I just answered this question here: http://www.aspose.com/community/forums/thread/230576/adding-text-to-the-footers.aspx

Best regards.