Background Color:
 
Background Pattern:
Reset
Search

Forum

Please Log In

We want you to contribute! 

This forum is a moderated environment. 
We try to keep it neat and tidy. In order to access the forum content we would like you to either or register.

HomeHomeScryberScryberDevelopment Que...Development Que...Custom Complex Binding StylesCustom Complex Binding Styles
Previous
 
Next
New Post
1/13/2016 5:07 AM
 

Hi!

I have built a custom complex binding control for version 0.9.0.0 like shown in https://www.scryber.co.uk/HowTo/tabid/133/loc/TopicHistory/ShowHistory/673/Default.aspx?topic=Custom+Complex+Binding+Component

It works and my complex content is bound correctly, however styles are not applying to components.  

Any ideas?

 
New Post
1/13/2016 5:23 PM
 

Hi

As long as you have updated the namespaces for v0.9 in the source it should be fine.

We have included the PlaceHolder component in v0.9 with includes the capabilities of the sample, if this is what you are looking for.

However - there should be no issue with the sample and it's styles. If you can post the xml content you are adding and the content of the file it is being added to, then we can take a look and see what is going on.

 
New Post
1/14/2016 12:22 AM
 

Hi - thanks for the quick response.

I tried the PlaceHolder component with the same result - no styling.  Here's the information:

This is the content being placed into the placeholder:

This is a test<pdf:Div><pdf:Br/></pdf:Div><pdf:Div><pdf:Span style:class='redact'>This paragraph should be styled</pdf:Span></pdf:Div><pdf:Div><pdf:Br/></pdf:Div><pdf:Div>This should not</pdf:Div>


This is the pdfx file:

<?xml version="1.0" encoding="utf-8" ?>

<?scryber parser-mode='Strict' parser-log='false' append-log='false' log-level='Warnings' ?>

<pdf:Document xmlns:pdf="Scryber.Components, Scryber.Components, Version=0.9.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"

              xmlns:style="Scryber.Styles, Scryber.Styles, Version=0.9.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"

              xmlns:data="Scryber.Data, Scryber.Components, Version=0.9.0.0, Culture=neutral, PublicKeyToken=872cbeb81db952fe"

              xmlns:smartSquad="SmartSquad.PDFComponents, SmartSquad.Service"

              id="NoteExport" compression="Compress" auto-bind="true">

  <Styles>

    <style:Style applied-type="pdf:Section" >

      <style:Font size="14pt" />

      <style:Text leading="20pt"/>

    </style:Style>

    <style:Style applied-type="pdf:Page" >

      <style:Font size="14pt" />

      <style:Text leading="20pt"/>

      <style:Margins left="15mm" right="15mm" bottom="10mm" top="10mm"/>

      <style:Page size="Letter" orientation="Portrait"/>

    </style:Style>

    <style:Style applied-class="pageContainer" >

      <style:Padding bottom ="-15mm"/>

    </style:Style>

    <style:Style applied-class="flowing">

      <style:Overflow action ="NewPage" split ="Any" />

      <style:Text whitespace-significant="true" />

    </style:Style>

    <style:Style applied-class="redact" >

      <style:Background color ="#FFD700"/>

    </style:Style>

  </Styles>

  <Info>

    <Title>

      <pdf:Label text="{item:title}" />

    </Title>

  </Info>

  <Pages>

    <data:XMLDataSource id="NoteData" xml-data="{item:note-data}"></data:XMLDataSource>

    <data:XMLDataSource id="NoteHistory" xml-data="{item:note-history}"></data:XMLDataSource>

    <pdf:Section id="FirstSection" >

      <Outline title="Summary" style:open="true" />

      <Content>

        <data:ForEach select="/Note" datasource-id="NoteData" >

          <Template>

            <pdf:Para style:class="flowing">

              <pdf:PlaceHolder contents ="{item:formatted-content}" />

            </pdf:Para>

          </Template>

        </data:ForEach>

      </Content>

    </pdf:Section>

  </Pages>

</pdf:Document>

 
New Post
1/14/2016 1:16 AM
 

OK - I think I get it.  A Span is an inline element so a background color cannot be assigned.  

Any suggestions on how to get some content inline to be highlighted?

Thanks.

 
New Post
1/14/2016 12:10 PM
 

Easiest way is to put a rectangle or panel behind the text (higher in the layout) with a background colour and relative positioning (x, y, width, height). It will not flow within your dynamic content, but will flow within the rest of the document.

Alternatively, use text colour, bold italic, underline to accentuate the text, rather than a specific background colour to the text.

Hope this helps.

 
Previous
 
Next
HomeHomeScryberScryberDevelopment Que...Development Que...Custom Complex Binding StylesCustom Complex Binding Styles