• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Comment intégrer un doc pdf dans un fichier ?

Contributor ,
Jan 21, 2019 Jan 21, 2019

Copy link to clipboard

Copied

Bonjour,

D'après un document PDF, comment le découper en plusieurs enregistrements :

1 - titre du chapitre

2 - texte du chapitre

et cela à partir d'un numéro de page.

Merci pour votre aide

Views

3.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 16, 2019 Apr 16, 2019

bien l'intention de profiter de la situation pour 


18 <---- N° de page

mettre complètement à nu deux ou trois candidats qu'il présenterait à son commanditaire, ce n'était justement pas lui qui aurait le

Votes

Translate

Translate
LEGEND ,
Jan 23, 2019 Jan 23, 2019

Copy link to clipboard

Copied

Je ne suis pas sûr de comprendre votre demande. Cependant, si vous essayez d'isoler des chapitres de texte, je pense qu'il y a un moyen de le faire. Cependant, il faut que le titre de chaque chapitre ait quelque chose d'unique à utiliser comme délimiteur. Par exemple, chaque chapitre peut avoir "Chapitre n" où "n" est un nombre. Cela pourrait indiquer le début d'un nouveau chapitre. Ou, si le titre est toujours au format "n - Titre du texte va ici" où un numéro est toujours le début d'un titre suivi d'un tiret et vous pouvez être assuré que rien dans le texte du titre n'a ce format , vous pouvez utiliser cela comme un délimiteur.

Est-ce que cela ressemble à quelque chose que vous pourriez faire?

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 24, 2019 Jan 24, 2019

Copy link to clipboard

Copied

Bonjour,

Merci pour votre réponse.

C'est en effet un préalable ! Moi je pensais plus à un style particulier.

Ma difficulté est surtout, ne connaissant pas PDF, le découpage.

Une fois le document chargé par l'utilisateur, comment automatiquement l'intégrer dans un fichier :

0 - clé

1 - titre du chapitre

2 - chapitre

Merci d'avance pour votre aide

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2019 Jan 24, 2019

Copy link to clipboard

Copied

Bonjour,

Malheureusement, je ne travaille pas beaucoup avec PDF non plus. Mais je sais que l'action CFPDF = "read" placera le texte (et je pense aussi les images) dans une variable; une seule chaîne contenant tout sauf les métadonnées. Cela devrait être analysé par votre code. Comme il n’existe pas de méthode native de détection des "chapitres" dans le fichier PDF, vous devez créer votre propre méthode de délimitation des chapitres.

Comme je l'ai suggéré précédemment, si le titre de chaque chapitre est dans un format particulier qui ne se trouve pas dans le texte du chapitre, une expression régulière doit pouvoir détecter le début (titre) de chaque chapitre. En utilisant cette méthode, vous devriez pouvoir obtenir l’index d’où commence le chapitre de la chaîne et utiliser mid () pour obtenir le titre et le texte de chaque chapitre, puis séparer le titre du texte.

Complexe, oui. Mais possible.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

Bonjour,

J'avoue ne pas savoir comment faire les coupures.

Une fois en variable, comment le faire ?

Merci de votre aide

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

Supposons que les titres sont tous dans le format suivant: 1 - Ceci est le titre du premier chapitre

Supposons que les titres ne comptent jamais plus de 50 caractères.

Supposons que ce format ne sera trouvé dans le texte d'aucun chapitre.

<cfpdf action="read" file="{user uploaded file}" variable="thisPDF" />
<cfset chapterArray = REmatchNoCase("[\t\n\r]{1}\d{1,3} - ([^\t\n\r]+)[\t\n\r]", thisPDF) />

Ceci recherche un onglet ou un retour chariot / nouvelle ligne suivi d'un nombre de 1 à 3 chiffres suivi d'un espace suivi d'un tiret suivi d'un espace suivi de tout ce qui n'est ni un onglet ni un retour chariot / nouvelle ligne, jusqu'à un autre chariot retour / nouvelle ligne est rencontrée. Ce sera idéalement le titre du chapitre.

chapterArray est un tableau de tout ce qui correspond à la description ci-dessus. (Soyez patient. J'invente cela au fur et à mesure.) Je vous propose d'itérer le tableau en utilisant REfindNoCase () de chaque valeur de tableau pour obtenir l'index de la correspondance et créer une liste des index. (Même pour moi, cela semble presque tiré par les cheveux.)

J'aurais peut-être besoin de réfléchir à cela. Il semble que ce sera plus difficile que prévu.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2019 Jan 25, 2019

Copy link to clipboard

Copied

Je ne fais normalement pas tout le travail à la demande de quelqu'un. Cependant, votre demande m'avait intriguée. Alors j'ai fait le travail. Et je suis heureux de l'avoir fait, car j'ai appris un peu.

Je vais télécharger un fichier texte contenant mon code. Cela devrait être facile à comprendre si l’on programme depuis au moins un an.

I do not normally do all the work for someone's request.  However, your request had me intrigued.  So I did the work.  And I am happy to have done it, because I learned a little bit.

I am going to upload a text file that contains my code.  It should be easily understood, if one has been programming for at least a year.

V/r,

^ _ ^

UPDATE: I can't upload a text file, so I'll paste it here.

<cfsilent>
    <cfscript>
        a = "
1 - First Chapter Title

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.

2 - Next Chapter Title

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.

3 - Third Chapter And Still Going

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.

4 - Fourth And Final Chapter

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.

5 - I Lied - Here Is Another Chapter

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.";

        chapterArray = REmatchNoCase("[\t\n\r]?\d{1,3} - [^\t\n\r]+[\t\n\r]{1}",a);
        titleAndText = arrayNew(1);
        separatedTT = arrayNew(1);
        indexList = ""; start = 1;
        for(i = 1; i lte arrayLen(chapterArray); i++){
            ndx = findNoCase(chapterArray,a,start);
            start = ndx + 1;
            indexList = listAppend(indexList,ndx);
            }
        count = 0;
        for(i = 1; i lte listLen(indexList); i++){
            start = listGetAt(indexList,i);
            if(i lt listLen(indexList)){
                count = listGetAt(indexList,i+1)-start;
                }
            else{
                count = len(a);
                }
            titleAndText = mid(a,start,count);
            }
    </cfscript>
</cfsilent><!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Untitled Document</title>
    </head>
    <body>
<cfdump var="#chapterArray#" /><cfoutput>#indexList#</cfoutput><cfdump var="#titleAndText#" />
    </body>
</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 26, 2019 Jan 26, 2019

Copy link to clipboard

Copied

Merci pour votre travail et tant mieux si vous avez pu apprendre quelque chose.

Je vais essayer et vous tiendrez au courant.

Encore merci

Cordialement

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 28, 2019 Jan 28, 2019

Copy link to clipboard

Copied

I just altered the code so that it will separate the title from the text and place them in separate columns.

Change the following line of code:

titleAndText = mid(a,start,count);

Use this, instead:

titleAndText[1] = trim(chapterArray);

titleAndText[2] = trim(replace(mid(a,start,count),chapterArray,'','all'));

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

Merci pour cette modification.

Je n'ai pas encore pu essayer car je suis encore bloqué par l'ajout d'un style Mime PDF.

Je ne sais comment le rajouter à la racine du site.

Merci pour votre aide

Cordialement

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

Vous ne devriez pas avoir à ajouter le type mime PDF à quoi que ce soit. Cela devrait fonctionner en mode natif. La balise CFPDF doit ouvrir et analyser le document PDF sans y apporter de modification. S'il existe un message d'erreur indiquant que le type mime PDF n'est pas suffisant, il y a probablement un problème avec le document PDF. Peut-être la méthode par laquelle le PDF a été créé.

You shouldn't have to add the PDF mime type to anything.  This should be working natively.  The CFPDF tag should be opening and parsing the PDF document without making any modifications.  If there is an error message indicating that the PDF mime type isn't sufficient, then there is most likely something wrong with the PDF document.  Perhaps the method by which the PDF was created.

HTH,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

Quelle version de ColdFusion utilisez-vous? Quel système d'exploitation?

What version of ColdFusion are you running?  What Operating System?

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

Rebonjour,

J'ai ColdFusion8 avec W10.

Quand je demande un document à l'utilisateur en PDF (input file), il faut bien que je restreins à un Mime précis ?

Merci pour votre aide.

Hello again,

I have ColdFusion8 with W10.

When I request a document to the user in PDF (input file), I must restrict myself to a precise Mime?

Thanks for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

Ah, maintenant je comprends. Vous souhaitez limiter le fichier téléchargé à être uniquement PDF.

Malheureusement, je ne pense pas que cela soit possible dans CF8. Dans les versions les plus récentes de ColdFusion, vous pouvez limiter uniquement le format PDF. En fait, CF examinera le fichier et déterminera le type MIME. Mais si je ne me trompe pas, CF8 ne se penchera que sur l’extension du fichier. Ce qui signifie que n'importe qui peut prendre un fichier .exe, le renommer en .pdf et le télécharger, et CF8 pensera que c'est un PDF.

Ah, now I understand.  You wish to restrict the uploaded file to be only PDF.

Unfortunatetly, I don't think this is possible in CF8.  More recent versions of ColdFusion, you can restrict to only PDF, and CF will actually look at the file and determine the mime type.  But CF8, if I'm not mistaken, will only look at the file extension.  Which means that anyone can take a .exe file, rename it to .pdf and upload it, and CF8 will think it's a PDF.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 03, 2019 Feb 03, 2019

Copy link to clipboard

Copied

Bonjour,

Je viens de voir dans un forum qu'il est possible d'ajouter un type Mime dans un fichier .htaccess à la racine du site.

Mais il n'y a pas d'exemples … pour débutant 😞

Vous connaissez ?

Merci encore pour aide

Cordialement

Hello,

I just saw in a forum that it is possible to add a Mime type in a .htaccess file at the root of the site.

But there are no examples ... for beginners 😞

You know ?

Thanks again for help

cordially

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2019 Feb 04, 2019

Copy link to clipboard

Copied

Malheureusement, je ne suis pas un administrateur Web. Je ne sais pas comment configurer un serveur Web comme IIS ou Apache pour limiter le téléchargement de fichiers. Je pense que les versions ultérieures de ColdFusion peuvent restreindre le type mime pouvant être téléchargé, mais je pense que ColdFusion 8 ne le peut pas, car il dépend de l'extension du fichier pour déterminer le type de fichier en cours de téléchargement. Ce type de fichier peut être facilement ignoré. renommer le fichier.

Unfortunately, I am not a web administrator.  I do not know how to set up a web server like IIS or Apache to restrict file uploads.  I do believe that later versions of ColdFusion can restrict the mime type that can be uploaded, but I believe that ColdFusion 8 cannot because it relies upon the file extension to determine what type of file is being uploaded, and that can be very easily bypassed by renaming the file.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 04, 2019 Feb 04, 2019

Copy link to clipboard

Copied

Bonsoir,

C'est mon administrateur web qui m'a conseillé aussi cela.

Donc c'est du soft à la racine de l'hébergement.

Mais comment faire ??

Merci pour l'aide

Good evening,

It was my web administrator who advised me that too.

So it's soft at the root of hosting.

But how to do it ??

thanks for the help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Bonjour,

Désolé de ne pas avoir donné de nouvelles mais … la maladie m'a rattrapée. !

Mais je suis sorti de l'hôpital … et guéri !!

Pour le type mime PDF, je suis passé à une version supérieure.

Pour le travail que vous avez fait (encore MERCI) sur le découpage, il reste un petit soucis : cela ne respecte pas la mise en page et donc les paragraphes.

Exemple :  dans le chapitre 4, il y a 3 paragraphes. Après traitement, cela se transforme en un seul.

Je ne vois pas la solution !

Auriez-vous une idée ?

ENCORE MERCI

Hello,Sorry

I did not give any news but ... the disease caught me. !But I got out of the hospital ... and healed !!

For the PDF mime type, I upgraded to a higher version.

For the work you have done (again THANK YOU) on cutting, there remains a small problem: it does not respect the layout and therefore the paragraphs.

Example: in chapter 4, there are 3 paragraphs. After treatment, it turns into one.

I do not see the solution!

Do you have an idea ?

THANKS AGAIN

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Malheureusement, je ne peux pas penser à une solution pour cela. Voulez-vous dire que les trois paragraphes sont concaténés en un seul paragraphe? Ou est-ce que seul le premier paragraphe est inclus, supprimant les deux autres paragraphes?

Sadly, I cannot think of a solution for this.  Are you saying that the three paragraphs are concatenated into one paragraph?  Or is only the first paragraph being included, removing the other two paragraphs?

V/r,

^ _ ^

UPDATE/METTRE À JOUR:

La première ligne du code que j'ai fourni, changez ceci:

The first line of the code I supplied, change to this:

chapterArray = REmatchNoCase("[\t\n\r]+\d{1,3}\s+-\s+[^\t\n\r]+[\t\n\r]{1}",a);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Bonjour,

C'est le premier cas. Les retours à la ligne entre les paragraphes sont supprimés ce qui ne fait qu'un paraphe.

1 - First Chapter Title 

 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

 

2 - Next Chapter Title 

 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

 

3 - Third Chapter And Still Going 

 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

 

4 - Fourth And Final Chapter 

 

Paragraph - Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  

 

Paragraph - Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

 

Paragraph - Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing. 

 

5 - I Lied - Here Is Another Chapter 

 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.   

 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.   

 

Lorem ipsum and all that jazz.  This is placement text and can be ignored.  This is just for testing.  Lorem ipsum

Merci

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Le nouveau code que j'ai posté devrait aider avec ceci. Les sauts de ligne dans le code apparaissent sous la forme d'un espace dans le navigateur. View Source devrait révéler les sauts de ligne dans le code. Le nouveau code remplace les sauts de ligne par une balise break, de sorte que de nouvelles lignes apparaissent dans le navigateur.

The new code that I posted should help with this.  Line breaks in code appear as a space in browser.  View Source should reveal the line breaks in the code.  The new code replaces line breaks with a break tag, so new lines appear in the browser.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Bonjour,

MERCI  ENCORE MERCI pour le travail effectué.

Mais je crois que je vais renoncer 😞  C'est au-dessus de mes capacités !

En effet quand un problème est résolu, il y en a un autre, surtout avec la langue française, avec les accents. J'ai fait un parser mais rien y fait. J'ai remplacé le "faux texte" par un vrai texte ! Rien n'y fait !

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<CFINCLUDE template="../inc_init_admin.cfm">
<title>Découpage PDF</title>
</head>

<body>
<cfsilent> 
    <cfscript>
a = "Le départ en vacances
Roselyne et Henri finissaient d'habiller leur deuxième enfant, encore tout endormi. Il était très tôt ce matin-là et ils s'étaient couchés tard la veille pour préparer leurs affaires. Leur fille Camille, plus grande, était déjà prête, après avoir pris un petit encas composé d’une tranche de pain de mie couverte de Nutella. Elle adorait ce goût de noisette et l’onctuosité de la crème qu’elle étendait toujours sur une tartine de pain de mie qu’elle faisait griller. L’odeur de pain grillé tout chaud et de la pâte Nutella qui caramélisait légèrement dessus lui titillait les narines et lui faisait penser aux contes pour enfants que sa mère lui lisait quand elle était petite. Elle regrettait de devoir grandir, même si le monde des adultes présentait bien des avantages.  Très souvent Camille accompagnait son petit déjeuner d’un verre de jus d’orange pour avoir en bouche le contraste entre l’amertume du fruit et le sucré de la tartine. C’est ce qu’elle avait fait ce matin et après, elle s’était habillée d’un pantalon très moulant en velours à fine cotte, vert émeraude, et d’un gros pull à col roulé un peu trop grand pour elle, vert bouteille. Le col lui retombait mollement sur la poitrine, les manches en accordéon dépassaient le bout de ses doigts, mais elle aimait ça. Elle avait chaussé des souliers genre bottines avec des sur-chaussettes très colorées qui couvraient une partie de son pantalon et retombaient de façon boudinée. Elle ne se maquillait pas. Jamais. Préférant rester « nature », son amour pour l’écologie la poussait à ne pas tricher avec sa beauté. Elle avait pris son air boudeur. Ses amies disaient qu'elle était très belle ainsi et les garçons semblaient être follement attirés  par sa grande bouche pulpeuse, toujours légèrement ente ouverte sur ses admirables dents. Elle avait du chien, comme on dit, et elle le savait. Pour l'heure, elle attendait patiemment assise dans le salon, son sac sur les genoux, que ses parents aient fini de s’occuper du « petit tyran » comme elle appelait son frère cadet. Henri, son père, était né en Algérie, du temps où ce pays était encore français. Il était un «pied-noir» comme ils s’appelaient euxmêmes, un français né en Algérie. Il était assez macho et reprochait à sa femme Roselyne de trop materner ce jeune garçon qui avait tout de même dix ans à présent. Mais il s'en occupait aussi, à sa manière, un peu comme on prend soin d'une chose personnelle que l'on veut façonner à sa main. Camille n’en trouvait pas ombrage. Cela l’arrangeait même, car ainsi, elle avait plus de liberté, bien qu’elle n’en profitât pas pour faire trop de bêtises. Son petit frère était en fait plutôt grand pour son âge, très vif, et déjà roublard. Poussé et soutenu par son père, il était le capitaine incontesté de son équipe de football, et avait tendance à s'imposer comme le meneur dans tous les jeux menés avec ses copains. Henri voulait que son fils réussisse dans la vie et toutes les occasions étaient bonnes pour le pousser à se dépasser, à être le meilleur. Il le poussait à effacer les autres pour se mettre en avant, à prendre la direction des opérations, à s'imposer en qualité de chef. Il avait sans arrêt avec lui ce genre de discussion :
- Tu dois être le meilleur partout, fiston. 
–  Pourquoi ça Papa ?
–  Parce qu’il en faut toujours un pour montrer l’exemple et que tu es capable d’être celui-là !
–  Mais si un copain veut aussi être le plus fort ?
– Tu dois lui dire que le meilleur, c’est toi et tu dois le provoquer. Il aura certainement peur de te voir si sûr de toi et il se dégonflera.
–  Et si…et si…et s'il se dégonfle pas et qu’il gagne ?
–  D’abord, on dit "s'il NE se dégonfle pas et qu’il gagne" Et ensuite, alors là, c’est à moi que tu auras affaire ! Mais cela n’arrivera pas. Tu es de la race des conquérants, tu as cela dans le  sang. Tu as ça dans les veines. Crois-moi ! Tu es le plus fort. 
–  Maman dit que, parfois, il faut laisser les autres s’exprimer et montrer ce qu’ils savent faire.
–  Maman se trompe. C’est une femme et elle ne sait pas ce que doit faire un homme s’il veut devenir un chef. Tu veux rester un larbin ou tu veux devenir un chef ? Tu préfères être le sergent Garcia ou devenir le chevalier Zorro ? Moi je t’apprends à devenir un chef, un leader, un patron ! Les autres te suivront parce que tu seras le plus fort, crois-moi.
–  Et ils m’obéiront tous ?
–  Oui, tous. Parce que tu oseras tout tenter, et si un jour tu rates un truc, tu ne devras jamais le reconnaître ! Jamais ! Si tu rates quelque chose, ce sera toujours à cause des autres et tu les accuseras. Du coup, ils penseront davantage à se défendre qu’à t’attaquer. Je vais t’apprendre tout ce qu'il faut, tu seras le premier et je serai fier de toi. 

Il ne fallait pas que son fils soit comme lui avait été dans sa jeunesse. Il se reprochait, en effet, de n'avoir pas osé quand il aurait pu le faire. Quand il aurait dû le faire. 

À l'école, il suivait les autres, même si parfois l'idée d'un jeu venait de lui. Plus tard, son cousin et un de leurs copains étaient partis visiter l'Europe, en pratiquant de l'auto-stop, lui n'avait pas voulu les suivre dans cette aventure, par peur de l'inconnu. Il n'avait pas osé non plus courtiser la plus belle fille du quartier, alors qu'elle lui faisait les yeux doux. Et, finalement, à cause de sa timidité, c'était un autre qu'elle avait épousé. Il n'avait pas osé entrer dans le "privé" au début de sa carrière et à présent, il n'était qu'un petit chef de service dans une administration poussiéreuse d'une petite ville de province. 

Il devait tout cela à toute une série de réflexions que son père avait faites à son propos pendant son enfance et son adolescence. Par exemple, Henri avait eu le jour de ses six ans, l’idée de se fabriquer une chaise à sa taille. En effet, les chaises à la maison étaient toutes trop grandes pour lui et il avait du mal à s’y asseoir seul. Sa mère l’aidait souvent et son père, quand il était là et voyait cela, disait toujours « mais quand est-ce qu'il va arriver à faire quelque chose tout seul, celui-là ! ». C’est pourquoi Henri avait eu l’idée de fabriquer une chaise qu’il pourrait utiliser sans l’aide de personne. Il espérait ainsi que son père serait enfin content de lui. 

L’entretien d’embauche

Alain Garcia regardait attentivement l’homme devant lui, assis nonchalamment dans un fauteuil noir en cuir confortable avec un dossier qui montait au-dessus de sa tête. Par moments, cet homme faisait pivoter son siège, comme pour dire : moi, je suis libre de mes mouvements, alors que toi, tu es coincé dans ta chaise basse, à ma merci. Il avait une attitude à la fois décontractée et hautaine. Ses jambes croisées négligemment laissaient augurer de sa suffisance. Sa main droite aux ongles parfaitement entretenus et manucurés de frais jouait sans cesse avec un coupe-papier en forme de petit poignard. Tantôt il le pointait vers Alain, tantôt il le faisait tourner entre ses doigts, la pointe posée sur le bureau. Il était habillé d’un costume croisé gris sombre, presque noir, rehaussé de légères rayures assez espacées très fines à peine plus claires. On sentait le tissu souple et soyeux, sortant d’un grand faiseur. Sa chemise d’un gris légèrement soutenu soulignait sa cravate couleur acier. Il était d’une élégance rare et racée.

Ses yeux étaient fixés sur Alain et épiaient le moindre de ses mouvements. Son regard perçant cherchait à découvrir la faille que pourrait traduire une moue, un cillement des paupières, un tremblement des mains, un regard fuyant. Manifestement, il n'était pas là pour aider Alain, mais pour le pousser dans ses derniers retranchements et lui faire dire quelque chose ou réaliser un geste qui, à ses yeux, pourrait l'éliminer. 

Car l'homme était un recruteur. Un chasseur de têtes, comme il convient de dire. Il avait passé un message dans la presse et sur le web quelques jours auparavant, et après un tri impitoyable des centaines de lettres et de courriel de réponses qu'il avait reçus, il en avait sélectionné arbitrairement une dizaine et recevait  à présent les candidats. Il avait appelé Alain deux jours auparavant.
–  Monsieur Garcia ? Cabinet des Prestataires de l’Indre. Vous avez répondu à l’une de nos annonces.
–  En effet, il s’agit d’un poste dans la distribution répondit Alain qui avait tout de suite fait le rapprochement.
–  Votre candidature présente quelques éléments intéressants. J’aimerais en discuter avec vous. Vous avez quelques minutes à me consacrer, là ? 

Alain voulait absolument décrocher un rendez-vous en face à face et ne tenait donc pas à faire un entretien téléphonique.
–  Oh ! Je regrette vraiment mais je partais à l’instant pour un rendez-vous personnel, je m’apprêtais à fermer ma porte quand le téléphone a sonné.
–  Bon, tant pis. Êtes-vous libre rapidement ? 
– Je peux vous rencontrer demain après midi ou mercredi matin si vous préférez proposa Alain.
–  Mercredi sera parfait. Je vous attends à 10 h 00. Cela vous convient mieux ?
–  C’est parfait. Qui dois-je demander à l’accueil ?
–  Je suis Christian Lejeune. Soyez à l’heure monsieur Garcia, je n’aime pas attendre ! 

Alain comprit que cet homme était assez orgueilleux et qu’il avait mal pris ce report d’entretien. Ce recruteur devait se prendre pour Dieu tout-puissant. Alain qui avait rencontré d’autres chasseurs de têtes comme lui, pensait que l’homme en éprouvait une certaine jouissance. Il pouvait donner un semblant d'espoir et de dignité à l'un des postulants. Un semblant seulement, car si le recruteur avait bien l'intention de profiter de la situation pour

 
18 <---- N° de page

mettre complètement à nu deux ou trois candidats qu'il présenterait à son commanditaire, ce n'était justement pas lui qui aurait le dernier mot, mais bien le futur employeur.   

Le chasseur de têtes se donnait ainsi l'illusion de la puissance. Car en réalité, et il devait bien le savoir au fond de lui, il n'était rien. Il était moins que ceux qui lui avaient écrit car eux, et en tout cas celui qui serait embauché, pourrait exercer un vrai pouvoir : celui de créer, de diriger, de gérer, de former d'autres hommes à un métier productif, générateur de richesses. Lui n'était que l'outil d'un client qui cherchait un collaborateur. 

En fait, c'était un mauvais recruteur comme il en existe hélas trop. Il n'était presque rien. Il était presque tout. Il devait le savoir et il s'en délectait sûrement. Alain avait rapidement jaugé le bonhomme et il comprenait que ce serait difficile pour lui. Il ne fallait surtout pas paraître supérieur car il serait éliminé. Il ne fallait pas paraître inférieur, car il serait méprisé. Alain devait aborder cet entretien d'une manière particulière pour parler de ses réussites et de ses aspirations. Il devait absolument trouver le moyen d'intéresser ce recruteur sans trop parler.  

Mais comment dire en quelques mots ce que l'on avait réalisé durant toute une carrière ou presque, ce que l'on ressentait, ce à quoi on aspirait dans la vie ? Par écrit ce n'était pas facile, et le recruteur n'examinait pas les lettres de motivation qui ressemblaient à des romans fleuves. Alain savait bien qu'il avait eu la chance de franchir ce premier obstacle dressé sur le parcours de sa recherche d'emploi. Il avait ensuite, ce matin même, répondu aux questions des tests qui lui avaient été soumis. Il s’agissait de tests de personnalité et de logique auxquels il s’était préparé depuis longtemps en faisant des mots croisés, en réalisant des tests de logique dans les revues spécialisées, et en étudiant aussi les dictionnaires de synonymes, homonymes et autres anagrammes. Et à présent, il se trouvait face à cet homme dont il avait un peu peur malgré tout."
 
   <cfset chr=#a#>
  <CFINCLUDE template="../inc_parser.cfm">
  <cfset a=#chr#>
       
  chapterArray = REmatchNoCase("[\t\n\r]+\d{1,3}\s+-\s+[^\t\n\r]+[\t\n\r]{1}",variables.a); 
        titleAndText = arrayNew(1); 
        indexList = ""; start = 1; 
        for(i = 1; variables.i lte arrayLen(variables.chapterArray); i++){ 
            ndx = findNoCase(variables.chapterArray,variables.a,variables.start);  
            start = variables.ndx + 1; 
            indexList = listAppend(variables.indexList,variables.ndx); 
            } 
        count = 0; 
        for(i = 1; variables.i lte listLen(variables.indexList); i++){ 
            start = listGetAt(variables.indexList,variables.i); 
            if(variables.i lt listLen(variables.indexList)){ 
                count = listGetAt(variables.indexList,variables.i+1)-variables.start; 
                } 
            else{ 
                count = len(variables.a); 
                } 
            titleAndText[variables.i]['title'] = trim(chapterArray[variables.i]); 
            titleAndText[variables.i]['text'] = REreplace(trim(replace(mid(variables.a,variables.start,variables.count),variables.chapterArray,'','all')),'[\t|\r|\n]','<br />','all'); 
            } 
    </cfscript> 
</cfsilent>
<!DOCTYPE HTML> 
<html> 
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
        <title>Chapter, Title, and Text from a string</title> 
    </head> 
    <body> 
        <cfdump var="#variables.chapterArray#" /> 
        <cfoutput>#variables.indexList#</cfoutput><cfdump var="#variables.titleAndText#" /><br /><br /> 
        <cfoutput> 
            <cfloop index="idx" from="1" to="#arrayLen(variables.titleAndText)#"> 
                <div>Title:  #variables.titleAndText[variables.idx]['title']#</div> 
                <div>Text:  #variables.titleAndText[variables.idx]['text']#</div> 
                <div><hr noshade /></div> 
            </cfloop> 
        </cfoutput> 
    </body> 
</html> 

inc_parser.cfm

<CFOUTPUT>
<cfset chr=" " & #chr# & " ">

<!--- ' --->
<cfset ca=chr(39)><cfset re="&##39;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!---  ù --->
<cfset ca=chr(151)><cfset re="&##151;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- " --->
<cfset ca=chr(153)><cfset re="&##153;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- æ --->
<cfset ca=chr(156)><cfset re="&aelig;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- £ --->
<cfset ca=chr(163)><cfset re="&pound;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- © --->
<cfset ca=chr(169)><cfset re="&copy;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>      
<!--- « --->
<cfset ca=chr(171)><cfset re="&##171;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ® --->
<cfset ca=chr(174)><cfset re="&reg;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ° --->
<cfset ca=chr(176)><cfset re="&##176;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ± --->
<cfset ca=chr(177)><cfset re="&sup1;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ² --->
<cfset ca=chr(178)><cfset re="&sup2;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ³ --->
<cfset ca=chr(179)><cfset re="&sup3;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ´ --->
<cfset ca=chr(180)><cfset re="&acute;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- » --->
<cfset ca=chr(187)><cfset re="&##187;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ¼ --->
<cfset ca=chr(188)><cfset re="&##188;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ½ --->
<cfset ca=chr(189)><cfset re="&##189;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ¾ --->
<cfset ca=chr(190)><cfset re="&##190;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- à --->
<cfset ca=chr(224)><cfset re="&agrave;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- â --->
<cfset ca=chr(226)><cfset re="&acirc;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>

<!--- ç --->
<cfset ca=chr(231)><cfset re="&ccedil;">
<cfset cpt=find(ca,chr)>

<CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)">
<cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)>
<cfset cpt=find(ca,chr)>
</CFLOOP>

<!--- è --->
<cfset ca=chr(232)><cfset re="&egrave;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- é --->
<cfset ca=chr(233)><cfset re="&eacute;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ê --->
<cfset ca=chr(234)><cfset re="&ecirc;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ë --->
<cfset ca=chr(235)><cfset re="&euml;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!---î--->
<cfset ca=chr(238)><cfset re="&icirc;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ï --->
<cfset ca=chr(239)><cfset re="&iuml;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ù --->
<cfset ca=chr(249)><cfset re="&ugrave;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- û --->
<cfset ca=chr(251)><cfset re="&ucirc;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>
<!--- ü --->
<cfset ca=chr(252)><cfset re="&uuml;">
<cfset cpt=find(ca,chr)><CFLOOP CONDITION="(Cpt IS NOT 0) AND (len(chr) LT 5000)"><cfset chr=left(chr,cpt-1)& "#re#" & right(chr,len(chr)-cpt)><cfset cpt=find(ca,chr)></CFLOOP>

<cfset ssep1=chr(39) & chr(34)>
<cfset ssep2=chr(34) & chr(39)>

<cfset chr=#replace(chr,ssep1,'"','ALL')#>
<cfset chr=#replace(chr,ssep2,'"','ALL')#>

<cfset chr=trim(chr)>
</CFOUTPUT>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

N'abandonnez pas, pour l'instant. Cela ne fonctionne pas car les titres ne sont pas au format "1 - Titre du titre" (sans les guillemets). L'expression régulière que j'ai créée s'appuie sur ce format. De plus, j'ai remarqué qu'une partie de la chaîne contient une balise de commentaire CF <! --- et aucune balise de fin.

La partie inférieure du code (inc_parser.cfm) Je n'ai aucune idée de ce que vous essayez de faire.

Don't give up, just yet.  It's not working because the titles are not in the format "1 - Title Name" (minus the quotes).  The Regular Expression that I created relies upon this format.  Also, I noticed that part of the string contains a leading CF comment tag <!--- and no ending tag.

The lower section of code (inc_parser.cfm) I have no idea what you are attempting to do.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

inc_parser.cfm : j'essaye de remplacer les accentués et autres signes de la langue française par leur code assci !

De plus, je ne vois pas de CF <! --- qui ne soit pas fermer !

Merci encore !

inc_parser.cfm: I try to replace the accented and other signs of the French language with their Assci code!

Moreover, I do not see CF <! --- who does not shut up!

Thanks again !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

bien l'intention de profiter de la situation pour 


18 <---- N° de page

mettre complètement à nu deux ou trois candidats qu'il présenterait à son commanditaire, ce n'était justement pas lui qui aurait le

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation