Incorrect page numbering when saving as .PDF

Last post 08-02-2010, 9:03 AM by aspose.notifier. 23 replies.
Page 1 of 2 (24 items)   1 2 Next >
Sort Posts: Previous Next
  •  10-02-2009, 4:44 PM 200854

    Incorrect page numbering when saving as .PDF .NET

    I am using Aspose.Words dll version 6.3.0.0.  I am merging several documents into one, and I want the page numbering to re-start with each section.  When I save the aggregated file as a .doc file, it is numbered correctly.  However, if I save the file as a .pdf, the first page of each section is 1, while the other pages are numbered with the cumulative page number.

    Here’s a simplified code example:

    Document doc = new Document()

    // Append multiple files to doc

    AddFiles(doc);

    doc.Save("Plan.doc");

    doc.Save("Plan.pdf");

     

    Plan.doc will have these correct page numbers: 1, 2, 3, 1, 2, 1, 2, 3, 4

    Plan.pdf will have these incorrect page numbers: 1, 2, 3, 1, 5, 1, 7, 8, 9

     

     
  •  10-03-2009, 12:37 PM 200898 in reply to 200854

    Re: Incorrect page numbering when saving as .PDF

    Hi

     

    Thanks for your inquiry. Could you please attach your documents here for testing? I will check the issue on my side and provide you more information.

     

    Also, please try using the latest version of Aspose.Words (7.0.0). You can download it from here:

    http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  10-04-2009, 2:10 AM 200915 in reply to 200898

    Re: Incorrect page numbering when saving as .PDF

    Attachment: Present (inaccessible)

    I just upgraded to v.7.0.0 and I am still having a problem.  The behavior has changed some, though.  The page numbers in the produced Word .doc are correctly labeled 1,2,3,1,2,3,4,5,6.  The page numbers in the produced .pdf file are 1,1,1,4,4,4,4,4,4.

    I've attached a zip file containing the following files:

    TOC.docx and Section1.doc - these individual files are merged into a document object.

    Plan.doc - product of saving the document object with a .doc file extension

    Plan.pdf - product of saving the document object with a .pdf file extension

    Thanks for your prormpt assistance with this matter.

    Regards,

    Darwin R. Pinder, Jr.

     
  •  10-04-2009, 6:30 AM 200920 in reply to 200915

    Re: Incorrect page numbering when saving as .PDF

    Hi

     

    Thank you for additional information. I managed to reproduce the problem on my side. You will be notified as soon as it is resolved.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  10-20-2009, 9:40 AM 203275 in reply to 200920

    Re: Incorrect page numbering when saving as .PDF

    Mr. Noskov,

    I just wanted to follow up on this issue with you.  Are you making progress towards a fix?  I'm getting a lot of pressure from my boss, as we can't go live with our new features until this is resolved.

    Thanks,

    Darwin Pinder

     
  •  10-20-2009, 10:57 AM 203289 in reply to 203275

    Re: Incorrect page numbering when saving as .PDF

    Hi Darwin,

     

    Thanks for your request. Unfortunately, the issue is still unresolved. We will let you know once the issue is fixed. I apologize for inconvenience.

     

    Best regards,


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  12-03-2009, 4:30 PM 211175 in reply to 203289

    Re: Incorrect page numbering when saving as .PDF .NET

    This issue has been identified for two months now, and it is becoming an embarrassment for me and my company.  My manager has asked for a progress report on the resolution of the page numbering bug.  Is there anything you can tell me besides "the issue is still unresolved"?  Thanks for your time.

    Regards,

    Darwin R. Pinder, Jr.
    MCSD, MCDBA, OCA

    Filed under: Page numbers;SaveToPdf
     
  •  12-04-2009, 3:33 AM 211263 in reply to 211175

    Re: Incorrect page numbering when saving as .PDF

    Hi Darwin,

     

    Thanks for your request. Unfortunately, we did not have a chance to resolve this issue yet. There are a lot of other important issues we have to work on. I added your request to my monthly report, so its priority will be increased. Please expect a reply before the next hotfix (within few weeks). We might just fix the problem by then or provide you more information.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  01-21-2010, 7:31 AM 218426 in reply to 211263

    Re: Incorrect page numbering when saving as .PDF .NET

    Has there been a hot-fix provided for this issue yet?  Thanks!

     
  •  01-21-2010, 7:55 AM 218431 in reply to 218426

    Re: Incorrect page numbering when saving as .PDF

    Hi

     

    Thanks for your request. I tried converting your document to PDF using the latest version of Aspose.Words and page numbers are correct. Could you please check with the latest version on your side and confirm that the issue is resolved. Then I will close the issue.

    You can download the latest version of Aspose.Words from here:

    http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  01-21-2010, 8:09 AM 218435 in reply to 218431

    Re: Incorrect page numbering when saving as .PDF .NET

    Attachment: Present (inaccessible)

    Hi Alexey,

    I've updated this post to explain a 2nd possibly related issue!

    Would you be able to try converting my attached DOCX document to PDF using the latest version of Aspose.Words?  I am experiencing (2) page numbering issues, as well.  However, I believe they are related.

    Issue 1: Please note the page numbers 6, 7, and 8 in the DOCX compared to the page numbers 6, 8, and 9 in the PDF.  For some reason when I'm converting the resulting PDF document has skipped the number 7, however no text or pages are missing after the conversion.

    Issue 2: Please note the last two pages of the converted PDF document - they are numbered 53 and 53.  I wonder if this is related to the first issue.  My assumption is the PDF conversion process is incrementing an internal variable to create page numbers within the document, but the last page number is defined by using a different variable - something like "total pages".

    Thanks!

    Chris

     
  •  01-21-2010, 9:51 AM 218461 in reply to 218435

    Re: Incorrect page numbering when saving as .PDF

    Hi Chris,

     

    Thank you for additional information. I tried converting your document to PDF using the latest version of Aspose.OWrds and I cannot reproduce the problem with page numbering. So please try using the latest version. As I can see you are using 6.3.0 version.

     

    Darwin, would you please check whether your issue is also resolved?

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  01-25-2010, 10:49 AM 218951 in reply to 218461

    Re: Incorrect page numbering when saving as .PDF

    Attachment: Present (inaccessible)

    Alexey,

    The page numbering looks resolved, but the new version has introduced a new issue.  When I try to merge two documents (TOC.docx and AppendixA.docx) into a single document (Plan.docx), extra spacing is added that messes up my formatting.  My production system is actually merging about a dozen files, and I only get the problem when AppendixA.docx is included.  The code I am using to merge the documents is below:

    public void MergeDocs()
    {
    Document dDoc = new Document("TOC.docx");
    Document sDoc = new Document(Program.DestDir + "AppendixA.docx");
    Aspose.Words.Rendering.PdfOptions opt = new Aspose.Words.Rendering.PdfOptions();

    foreach
    (Section sSec in sDoc.Sections)
    {
       
    if (sSec.NodeType != NodeType.HeaderFooter)
       {
       
    Section nSec = (Section)dDoc.ImportNode(sSec, true);
       
    dDoc.Sections.Add(nSec);
       }
    }
    dDoc.Save(Program.DestDir + "Plan.docx");

    }

    Thanks in advance for your assistance.

    Regards,

    Darwin R. Pinder, Jr.

     
  •  01-25-2010, 1:40 PM 218991 in reply to 218951

    Re: Incorrect page numbering when saving as .PDF

    Hi Darwin,

     

    Thank you for additional information. I closed the issue with page numbering.

    Code to merge two document could be much simpler than yours. Please see the following code:

     

    Document dst = new Document(@"Test001\TOC.docx");

    Document src = new Document(@"Test001\AppendixA.docx");

     

    dst.AppendDocument(src, ImportFormatMode.KeepSourceFormatting);

     

    dst.Save(@"Test001\out.docx");

     

    Using this code, I cannot reproduce the problem with spacing. Hope this could help you.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  01-25-2010, 2:04 PM 218997 in reply to 218991

    Re: Incorrect page numbering when saving as .PDF

    Alexey,

    Thank you, your code example is much more concise (simpler == better).  However, I am still experiencing problems with spacing.  You'll notice TOC.docx is 4 pages long, and AppendixA.docx is 2 pages long.  When using your code to append AppendixA to TOC, the resultant document is 10 pages long, and not 6.  I have also tried using the UseDestinationStyles enumeration value, which resulted in a 12 page document.

    Thanks,

    Darwin Pinder

     
Page 1 of 2 (24 items)   1 2 Next >
View as RSS news feed in XML