Skip to main content
Participant
September 3, 2021
Question

Sample .NET Core Project PDF Split Limited to 20 Pages

  • September 3, 2021
  • 1 reply
  • 1013 views

I downloaded the SplitPDFIntoNumberofFiles C# project from Adobe SDK. 

 

The code below works sucessfully when splitting a PDF document to 20 pages, but if I set it over 20 pages, I get an exception error that the operation could not split beyond 20 pages.

 

// Set the number of documents to split the input PDF file into.
splitPDFOperation.SetFileCount(20);

 

Can anyone please provide any guidance or assistance ?

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    September 3, 2021

    I'm not understanding your question. You seem to be trying to split a document into 20 page chunks but the code you are showing is telling the split operation to break the file up into 20 separate files and allow the service to determine the number of pages.

    Participant
    September 3, 2021

    Hi @Joel Geraci , 

     

    I need to split a PDF document that has more than 20 pages, but the function only allows me to split up to 20 pages. 

     

    I should stated that when I call the function to split beyond 20 pages, an error occurs.

     

    // Set the number of documents to split the input PDF file into.
    splitPDFOperation.SetFileCount(30);

     

    If I set it below to 20 or below, it works. It does not work when I set it over 20. I hope that is clear.

    I attached the error as well.

    Participant
    September 3, 2021

    To provide more information from the error I am receiving from the Adobe API, please see the error log below:

     

    2021-09-03 11:08:26,360 ERROR SplitPDFIntoNumberOfFiles.Program - Exception encountered while executing operation
    System.ArgumentException: Input PDF file cannot be split into more than 20 documents