Skip to main content
Inspiring
August 19, 2022
Question

Découpage d'un fichier word en plusieurs fichiers

  • August 19, 2022
  • 3 replies
  • 1920 views

Bonjour,

Ayant un fichier word d'un livre, je voudrais le découper automatiquement par chapitre.

Le problème est que je ne sais pas par où commencer 

 

Est-il plus facile de la transformer avant en pdf ?

Merci pour vos idées.

Cordialement

 

Hello,

Having a word file of a book, I would like to automatically split it by chapter.

Problem is, I don't know where to start 

 

Is it easier to convert it to pdf before?

Thank you for your ideas.

cordially

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
September 3, 2022

1.

Avec Word vous exportez en PDF en cochant les options "Balisage" et "incorporer les signets" en vous assurant que les chapitres correspondent bien aux signets de premier niveau.

 

2.

Ensuite vous ouvrez le PDF avec Acrobat Pro et vous demandez  "Fractionner par : Signets de niveau supérieur".

 

Acrobate du PDF, InDesigner et Photoshopographe
ZNBAuthor
Inspiring
September 6, 2022

Bonjour,

Votre réponse est interessante !

Mais est-il possible de la faire automatiquement par programme ?

Merci par avance !

JR Boulay
Community Expert
Community Expert
September 1, 2022

"N'est-il pas possible de repérer la balise qui entraine le changement de page ?

Car le changement de chapitre se caractérise par un saut de page."

Si chaque chapitre est une page il suffit de découper le document en autant de pages.

Si certains chapitres font plusieurs pages on ne peut pas utiliser le saut de page pour détecter les chapitres.

Acrobate du PDF, InDesigner et Photoshopographe
ZNBAuthor
Inspiring
September 3, 2022

Bonjour

Merci pour la réponse !

Mais quoi utiliser pour détecter le changement de paragraphe ?

Quelle est la balise qui fait que le document doit commencer par une nouvelle page ?

Merci par avance

Souvik Sadhu
Community Manager
Community Manager
August 19, 2022

Hello ZNB,

 

I hope you are doing well. Per the description, I understand that you want to split files into chapters.

 

I suggest converting the file to PDF and then using the split feature. You may refer to the link to know more about the feature: How to split a PDF file into separate PDFs online (adobe.com)

 

Let me know if it helps.

 

Thanks,

Souvik.

ZNBAuthor
Inspiring
August 20, 2022

Bonjour,

Avant tout, merci pour votre réponse !

C'est exactement ce que je veux faire mais je voulais pouvoir le faire sans manipulation manuelle.

Merci pour votre aide 

NB : quelle est la balise, pour PDF, qui signale un saut de page ?

Jean-Marie

 

Hello,

First of all, thank you for your answer!

This is exactly what I want to do but I wanted to be able to do it without manual manipulation.

Thanks for your help

NB: what is the tag, for PDF, which signals a page break?

Jean-Marie

 

Souvik Sadhu
Community Manager
Community Manager
August 22, 2022

@ZNB Hi,

 

For this, you would need to apply JavaScript for the process.

 

To enable JavaScript, go to preferences-> JavaScript-> Enable Acrobat JavaScript.

 

Once done, you can try adding the below code:

Split();

function Split() {
    var totalPages = this.numPages; 
    var i;
    var arrNames = [ "The word you want" ];
    var targetPath  = "/C/Users/...SOMEPATH/";

    try { 
        for (i = 0; i  < totalPages; i++) {
            this.extractPages({
            nStart: i,
            cPath: targetPath +arrNames[i] + ".pdf"
        }); 

        console.println("Completed: " + targetPath + arrNames[i] + ".pdf");
        }
    } catch (e) {
        console.println("Aborted: " + e);
    }
 }

 

**Note: You will need a common word at the beginning of every chapter to be able to split correctly.

 

Let me know if this code helps.

 

Thanks,

Souvik.