c# - Adding a section to ContentRange GemBox -


i trying add whole section particular occurence using gembox.

section section = new section(documentmodel); documentmodel.sections.add(section);  contentrange backgroundchecksection = documentmodel.content.find("@@backgroundchecks").first(); backgroundchecksection.start.insertrange(section); 

this code not work since cannot implicity conver contentrange object section object. goal add whole section variable @@backgroundchecks appears. havent figured out how , wondering if me out.

i'm not 100% sure want accomplish, in order insert section's content range need following:

backgroundchecksection.start.insertrange(section.content); 

if provide more details want achieve out further.

nevertheless presume want not insert section (this split section in you're inserting 2 you'll end 3 sections) in document, want insert content of section specified place (where placeholder "@@backgroundchecks" is).

so instead of inserting "section.content" can iterate through "section.blocks" , insert content, following:

foreach(var block in section.blocks)     backgroundchecksection.start.insertrange(block.content); 

after you'll want remove placeholder:

backgroundchecksection.delete(); 

in case want insert section note each section separated section break , can manipulate section starts (for example start on new page or continues right after previous section). setting "section.pagesetup.sectionstart" property.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -