0

All went well until the client said he wants the first page of the pdf to be the cover. This means the first page should have no margins, and the next ones should. My base class that I inherited all my export files from had in it's constructor this:

public ExportPDF()
{
    this.document = new Document();
    this.document.DefaultPageSetup.Orientation = Orientation.Portrait;

    this.document.Info.Author = GlobalBL.AdministratorFullName;
    this.document.FootnoteLocation = FootnoteLocation.BottomOfPage;
    this.document.FootnoteNumberStyle = FootnoteNumberStyle.Arabic;
    this.document.FootnoteStartingNumber = 1;

    this.document.DefaultPageSetup.PageFormat = PageFormat.A4;
    this.document.DefaultPageSetup.TopMargin = "1cm";
    this.document.DefaultPageSetup.BottomMargin = "2cm";
    this.document.DefaultPageSetup.LeftMargin = "1cm";
    this.document.DefaultPageSetup.RightMargin = "1cm";
    this.document.DefaultPageSetup.HeaderDistance = "0cm";
    this.document.DefaultPageSetup.FooterDistance = "0cm";
    this.document.UseCmykColor = false;

    DefineStyles();

    this.section = this.document.AddSection();
}

I have noticed that even if I comment the footnote part, nothing changes, I still get the foot note numbering. So in this format, all the pages would get the margins. If I take them out, the cover looks perfect, but the rest of the pages don't. But there I guess at every exported item I could do an indent or something, don't know yet, maybe someone could have an idea on that too...But could one get rid of the page numberings, and more important, how can I skip the first page(the cover) from being numbered? Really hope someone could help. Thanks

bokkie
  • 1,477
  • 4
  • 21
  • 40

1 Answers1

0

Footnotes are footnotes. I presume you do not use footnotes in your document.

Header and Footer are a different story. Typically you use a Footer to add page numbers. I presume that's what you do.

What I would do in your case: use one section for the cover page, and create a new section for the rest of the document (method AddSection() of the Document class).

You should not change the DefaultPageSetup anyway. Each section has it's own PageSetup, so you can set different margins for the cover page and the rest of the document.