Sign In  Sign Up Live-Chat

Replaceable symbol $Sp evaluates to zero on every page

Last post 08-04-2007, 11:11 PM by WillDyson. 7 replies.
Sort Posts: Previous Next
  •  08-02-2007, 4:44 PM 89104

    Replaceable symbol $Sp evaluates to zero on every page

    I am trying to use the replacable symbols for section page number ($Sp) and section page count ($SP). However, the $Sp symbol always evaluates to zero. The page count symbol appears to work correctly.

    http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf/SymbolsListAndPurpose.html

    This is using Aspose.PDF 3.5.6.

    Thanks!
     
  •  08-02-2007, 7:25 PM 89120 in reply to 89104

    Re: Replaceable symbol $Sp evaluates to zero on every page

    I can't reproduce this error. Can you please provide the code?

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-02-2007, 8:35 PM 89128 in reply to 89120

    Re: Replaceable symbol $Sp evaluates to zero on every page

    Attachment: Present (inaccessible)
    A program to demonstrate the error follows (and is attached as well). What am I doing wrong here?



    using System;
    using System.Collections.Generic;
    using System.Text;
    using Aspose.Pdf;

    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                Pdf test = new Pdf();
               
                Section sec = new Section(test);

                HeaderFooter header = new HeaderFooter(sec);
                sec.EvenHeader = header;
                sec.OddHeader = header;

                header.Margin.Top = 120;

                Text pageIfo = new Text(header,"SectionPage $Sp/$SP\nPage $p/$P");
               
                header.Paragraphs.Add(pageIfo);

                for (int i = 0; i < 2; i++)
                {
                    Text pageBreak = new Text("");
                    pageBreak.IsFirstParagraph = true;
                    sec.Paragraphs.Add(pageBreak);

                    Text pageStuff = new Text("hi there");
                    sec.Paragraphs.Add(pageStuff);
                }

                test.Sections.Add(sec);

                test.Save(@"C:\Documents and Settings\Will\My Documents\test.pdf");
            }
        }
    }



     
  •  08-02-2007, 8:55 PM 89129 in reply to 89128

    Re: Replaceable symbol $Sp evaluates to zero on every page

    I have reproduced this error and logged this issue as PDFNET-3511. We will try to fix it soon.

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-03-2007, 1:21 PM 89277 in reply to 89129

    Re: Replaceable symbol $Sp evaluates to zero on every page

    Thanks Tommy!

    In the mean time, is there any workaround for this?
     
  •  08-03-2007, 8:38 PM 89304 in reply to 89277

    Re: Replaceable symbol $Sp evaluates to zero on every page

    Currently you can't make both $p and $Sp work well. If you want to display page number in section only, as a workaround, you can use $p and set the Section.IsPageNumberRestarted and Section.StartingPageNumber.
    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-04-2007, 10:21 PM 89339 in reply to 89304

    Re: Replaceable symbol $Sp evaluates to zero on every page

    Attachment: Present (inaccessible)
    This bug has been fixed. You can try the attachment before we publishing the hotfix.

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-04-2007, 11:11 PM 89342 in reply to 89339

    Re: Replaceable symbol $Sp evaluates to zero on every page

    I've tested, and can confirm this works on my production code.

    Thanks!
     
View as RSS news feed in XML