Highlighted

Create PDF

Participant ,
Sep 25, 2019

Copy link to clipboard

Copied

Bonjour,

Je voudrais créer un PDF suite à une mémorisation dans une variable :

<CFOUTPUT>	
	<!--- Debut de la memorisation des informations dans C --->
	<cfset C= "">
	<cfset C=C & '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'& #CRLF#> 
	<cfset C=C & '<html>'& #CRLF#>  
	<cfset C=C & '<head>'& #CRLF#>  
	<cfset C=C & '<title>Les aventures de l'extrème</title>'& #CRLF#>  
	<cfset C=C & '</head>'& #CRLF#>  
	<cfset C=C & '<body>'& #CRLF#> 
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>'& #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
    <cfset C=C & '<p><br /></p>'& #CRLF#>
    <cfset C=C & '<p style="text-align: center;">Albert Dupontel</p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<h1 style="text-align: center;"><h1>Les aventures de l'extrème</h1>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<p><br /></p>' & #CRLF#>
	<cfset C=C & '<p><br /></p>' & #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>'& #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;">Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;">Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>' & #CRLF#> 
	<cfset C=C & '<p style="text-align: center;">que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>' & #CRLF#> 
	<cfset C=C & '<p style="text-align: center;">une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>' & #CRLF#>
	<cfset C=C & '<p style="text-align: center;"> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;">&copy; Albert Dupontel</p>' & #CRLF#>
 	<cfset C=C & '<p style="text-align: center;">D&eacute;pot l&eacute;gal : #DateFormat(Now(),"YYYY-MM-DD")#</p>' & #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;">Adaptation e-book : #DateFormat(Now(),"YYYY-MM-DD")#</p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><u><a href="http://Abertdupontel@hotmail.com/">Abert Dupontel</a></u></p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<h2>Avertissement</h2>'& #CRLF#>
	<cfset C=C & 'Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé, ainsi que les lieux. Bien sûr les dialogues sont inventés, les situations imaginées, les sentiments romancés.
'& #CRLF#>
	<cfset C=C & '</body>'& #CRLF#>
	<cfset C=C & '</html>'& #CRLF#>
	
	
	
	<!---  Construction et affichage du PDF --->
	<CFDOCUMENT format="PDF" 
				filename="MyPDF.pdf" 
				overwrite="Yes">
				#C#
	</CFDOCUMENT> 
	
	<cfheader name="Content-Disposition" 
		      value="attachment;filename=MyPDF.pdf"> 
	<cfcontent type="application/PDF"
			   file="#DIR#/MyPDF.pdf" 
			   deletefile="Yes"> 

	<!---  Ecriture du PDF --->
	<CFFILE action="WRITE" 
			file="#DIR#/MyPDF.pdf"  
			output="#C#">   
			
</CFOUTPUT>

 A chaque fois j'ai le même message : Nous n'avons pas pu ouvrir le PDF. Un problème empéche l'ouverture du PDF.

Je pensais que cela pouvait venir des accentués mais mais malgré un parser, j'ai le même résultat.

Merci pour votre aide.

Bonjour,

Je voulais vous remercier tous (et surtout BKBK) pour votre aide et pour votre ... patience.

J'ai appris beaucoup de choses.

Encore merci

Cordialement

 

Hello,

I wanted to thank you all (and especially BKBK) for your help and for your ... patience.

I learned a lot of things.

Thanks again

Cordially

TOPICS
Advanced techniques

Views

544

Likes

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

Create PDF

Participant ,
Sep 25, 2019

Copy link to clipboard

Copied

Bonjour,

Je voudrais créer un PDF suite à une mémorisation dans une variable :

<CFOUTPUT>	
	<!--- Debut de la memorisation des informations dans C --->
	<cfset C= "">
	<cfset C=C & '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'& #CRLF#> 
	<cfset C=C & '<html>'& #CRLF#>  
	<cfset C=C & '<head>'& #CRLF#>  
	<cfset C=C & '<title>Les aventures de l'extrème</title>'& #CRLF#>  
	<cfset C=C & '</head>'& #CRLF#>  
	<cfset C=C & '<body>'& #CRLF#> 
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>'& #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
    <cfset C=C & '<p><br /></p>'& #CRLF#>
    <cfset C=C & '<p style="text-align: center;">Albert Dupontel</p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<h1 style="text-align: center;"><h1>Les aventures de l'extrème</h1>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
  	<cfset C=C & '<p><br /></p>'& #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<p><br /></p>' & #CRLF#>
	<cfset C=C & '<p><br /></p>' & #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>'& #CRLF#>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;">Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;">Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>' & #CRLF#> 
	<cfset C=C & '<p style="text-align: center;">que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>' & #CRLF#> 
	<cfset C=C & '<p style="text-align: center;">une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>' & #CRLF#>
	<cfset C=C & '<p style="text-align: center;"> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p style="text-align: center;">&copy; Albert Dupontel</p>' & #CRLF#>
 	<cfset C=C & '<p style="text-align: center;">D&eacute;pot l&eacute;gal : #DateFormat(Now(),"YYYY-MM-DD")#</p>' & #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;">Adaptation e-book : #DateFormat(Now(),"YYYY-MM-DD")#</p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><u><a href="http://Abertdupontel@hotmail.com/">Abert Dupontel</a></u></p>' & #CRLF#>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<h2>Avertissement</h2>'& #CRLF#>
	<cfset C=C & 'Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé, ainsi que les lieux. Bien sûr les dialogues sont inventés, les situations imaginées, les sentiments romancés.
'& #CRLF#>
	<cfset C=C & '</body>'& #CRLF#>
	<cfset C=C & '</html>'& #CRLF#>
	
	
	
	<!---  Construction et affichage du PDF --->
	<CFDOCUMENT format="PDF" 
				filename="MyPDF.pdf" 
				overwrite="Yes">
				#C#
	</CFDOCUMENT> 
	
	<cfheader name="Content-Disposition" 
		      value="attachment;filename=MyPDF.pdf"> 
	<cfcontent type="application/PDF"
			   file="#DIR#/MyPDF.pdf" 
			   deletefile="Yes"> 

	<!---  Ecriture du PDF --->
	<CFFILE action="WRITE" 
			file="#DIR#/MyPDF.pdf"  
			output="#C#">   
			
</CFOUTPUT>

 A chaque fois j'ai le même message : Nous n'avons pas pu ouvrir le PDF. Un problème empéche l'ouverture du PDF.

Je pensais que cela pouvait venir des accentués mais mais malgré un parser, j'ai le même résultat.

Merci pour votre aide.

Bonjour,

Je voulais vous remercier tous (et surtout BKBK) pour votre aide et pour votre ... patience.

J'ai appris beaucoup de choses.

Encore merci

Cordialement

 

Hello,

I wanted to thank you all (and especially BKBK) for your help and for your ... patience.

I learned a lot of things.

Thanks again

Cordially

TOPICS
Advanced techniques

Views

545

Likes

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
Sep 25, 2019 0
LEGEND ,
Sep 25, 2019

Copy link to clipboard

Copied

Bonjour, ZNB.

 

Tout d’abord, vous n’avez pas à enregistrer le contenu dans une chaîne comme vous le faites. Utilisez CFSAVECONTENT, placez le code HTML entre les balises d'ouverture et de fermeture et utilisez l'attribut variable = "C" dans la balise d'ouverture. C'est beaucoup plus facile à faire et à lire. 🙂

 

First of all, you do not have to save the content into a string as you are doing. Use CFSAVECONTENT, place the HTML between the opening and closing tags, and use the variable="C" attribute in the opening tag. It is much easier to do, and to read. 🙂

 

 

<cfsavecontent variables="C">Place your HTML here, and access via #C#.</cfsavecontent>

 

 

OU, selon la page d'aide de CFDOCUMENT, vous pouvez simplement placer le code HTML entre les balises cfdocument d'ouverture et de fermeture.

 

OR, according to the CFDOCUMENT help page, you can just place the HTML between opening and closing cfdocument tags.

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-d-e/cfdocument.html

 

De plus, dans la balise CFSET, à moins que vous placiez une variable CF dans les guillemets, vous n’avez pas besoin des hashtags. Votre & # CRLF #> peut donc être juste & & CRLF> Utiliser les hashtags en dehors d’une chaîne peut ralentir votre site ou application.

 

Also, within the CFSET tag, unless you are placing a CF variable within the quotes, you don't need the hashtags, so your & #CRLF#> can just be & CRLF> Using the hashtags outside of a string can slow down your site or application.

 

Le code que vous fournissez ressemble à celui que vous essayez de créer un PDF, puis enregistrez-le au format PDF. Je pense que la méthode la plus simple consiste à utiliser CFSAVECONTENT pour créer le contenu, puis à utiliser CFFILE pour l'enregistrer au format PDF directement, sans utiliser CFCONTENT / CFHEADER. CFCONTENT et CFHEADER sont utilisés lorsqu’un fichier est présenté à l’utilisateur pour être sauvegardé ou ouvert dans le navigateur, et tout ce qui suit est ignoré.

 

The code you are providing looks like you are trying to create a PDF, then save it as a PDF. I think the easiest method is to use CFSAVECONTENT to create the content, then use CFFILE to save it as a PDF, directly, without using the CFCONTENT/CFHEADER. CFCONTENT and CFHEADER are used when presenting a file to the user to either save or open in browser, and anything after them is ignored.

 

HTH,

 

^ _ ^

Likes

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
Reply
Loading...
Sep 25, 2019 0
Adobe Community Professional ,
Sep 25, 2019

Copy link to clipboard

Copied

l'extrème

devient

l''extr&egrave;me

(deux fois)

 

Donc

...
<cfset C=C & '<title>Les aventures de l''extr&egrave;me</title>'& #CRLF#>
...
<cfset C=C & '<h1 style="text-align: center;"><h1>Les aventures de l''extr&egrave;me</h1>'& #CRLF#>
...

Likes

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
Reply
Loading...
Sep 25, 2019 0
Adobe Community Professional ,
Sep 26, 2019

Copy link to clipboard

Copied

Et aussi...

 

 

 

<!--- Debut de la memorisation des informations dans C --->
<cfset C= "">
<cfset C=C & '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'& #CRLF#>
<cfset C=C & '<html>'& #CRLF#>
<cfset C=C & '<head>'& #CRLF#>
<cfset C=C & '<title>Les aventures de l''extr&egrave;me</title>'& #CRLF#>
<cfset C=C & '</head>'& #CRLF#>
<cfset C=C & '<body>'& #CRLF#>
<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;"><br /></p>'& #CRLF#>
<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<p style="text-align: center;">Albert Dupontel</p>'& #CRLF#>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<h1 style="text-align: center;"><h1>Les aventures de l''extr&egrave;me</h1>'& #CRLF#>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<p><br /></p>'& #CRLF#>
<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
<cfset C=C & '<p><br /></p>' & #CRLF#>
<cfset C=C & '<p><br /></p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;"><br /></p>'& #CRLF#>
<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;">Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;">Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;">que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;">une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;"> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;">&copy; Albert Dupontel</p>' & #CRLF#>
<cfset C=C & '<p style="text-align: center;">D&eacute;pot l&eacute;gal : #DateFormat(Now(),"YYYY-MM-DD")#</p>' & #CRLF#>
<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;">Adaptation e-book : #DateFormat(Now(),"YYYY-MM-DD")#</p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><u><a href="http://Abertdupontel@hotmail.com/">Abert Dupontel</a></u></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & #CRLF#>
<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
<cfset C=C & '<h2>Avertissement</h2>'& #CRLF#>
<cfset C=C & 'Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé, ainsi que les lieux. Bien sûr les dialogues sont inventés, les situations imaginées, les sentiments romancés.
'& #CRLF#>
<cfset C=C & '</body>'& #CRLF#>
<cfset C=C & '</html>'& #CRLF#>

<!--- Construction et écriture du PDF --->
<CFDOCUMENT format="PDF"
filename="MyPDF.pdf"
overwrite="Yes">
<cfoutput>#C#</cfoutput>
</CFDOCUMENT>

<cfheader name="Content-Disposition"
value="attachment;filename=MyPDF.pdf">
<cfcontent type="application/PDF"
file="#expandpath('MyPDF.pdf')#"
deletefile="YES"> <!--- Efface le fichier --->

<!---  N'efface pas le fichier --->
<!---
<cfheader name="Content-Disposition"
value="attachment;filename=MyPDF.pdf">
<cfcontent type="application/PDF"
file="#expandpath('MyPDF.pdf')#"
deletefile="NO">
--->

 

 

Likes

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
Reply
Loading...
Sep 26, 2019 0
Participant ,
Sep 30, 2019

Copy link to clipboard

Copied

Bonjour,

J'ai essayé tout ce que vous m'avez conseillé.

Malheureusement, j'ai le même message.

Pas de changement !

Merci pour votre aide

 

Hello,

I tried everything you advised me.

Unfortunately, I have the same message.

No change !

Thanks for your help

 

Likes

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
Reply
Loading...
Sep 30, 2019 0
Adobe Community Professional ,
Sep 30, 2019

Copy link to clipboard

Copied

What message?

Likes

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
Reply
Loading...
Sep 30, 2019 0
Adobe Community Professional ,
Sep 30, 2019

Copy link to clipboard

Copied

I tested your code as follows:

 

<cfset CRLF=chr(13) & chr(10)>

<!--- Debut de la memorisation des informations dans C --->
<cfset C= "">
<cfset C=C & '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'& #CRLF#>
<cfset C=C & '<html>'& #CRLF#>
<cfset C=C & '<head>'& #CRLF#>
...et cetera
<cfset C=C & '</html>'& #CRLF#>

<!--- Construction et écriture du PDF --->
<CFDOCUMENT format="PDF"
filename="MyPDF.pdf"
overwrite="Yes">
<cfoutput>#C#</cfoutput>
</CFDOCUMENT>

<cfheader name="Content-Disposition"
value="attachment;filename=MyPDF.pdf">
<cfcontent type="application/PDF"
file="#expandpath('MyPDF.pdf')#"
deletefile="YES"> <!--- Efface le fichier --->

 

It works as expected!

Likes

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
Reply
Loading...
Sep 30, 2019 0
LEGEND ,
Sep 30, 2019

Copy link to clipboard

Copied

The downside to what ZNB is attempting is that if there are more than one person using this, the file will be over-written for each person, and the files would most likely get mixed up, if it worked at all. It shouldn't be saved to disk, it should be retained in memory so that it goes to the correct user. V/r, ^ _ ^

Likes

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
Reply
Loading...
Sep 30, 2019 0
Adobe Community Professional ,
Sep 30, 2019

Copy link to clipboard

Copied

I agree, WolfShade. In fact, the code can be improved in many places. As you pointed out earlier.

For now, my aim is to help ZNB to get rid of any errors.  

Likes

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
Reply
Loading...
Sep 30, 2019 0
Participant ,
Oct 01, 2019

Copy link to clipboard

Copied

Hello,This is not the case ! Only one person will have access to this document.On the other hand, I would like to keep a copy.cordially

Likes

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
Reply
Loading...
Oct 01, 2019 0
LEGEND ,
Oct 01, 2019

Copy link to clipboard

Copied

Well, if only one person will be accessing this, then it isn't really an issue. However, there are better ways to achieve what you want. And if you need a copy of the file, you can always have it emailed to you.

 

V/r,

 

^ _ ^

 

UPDATE:  Odd.. initially entering a reply only gives one an input field; but if you edit it, you get the full editor.  Hm..

Likes

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
Reply
Loading...
Oct 01, 2019 0
Adobe Community Professional ,
Oct 01, 2019

Copy link to clipboard

Copied

ZNB, I asked you a question. No answer. I reminded you of a version of your code that works as expected. No reaction from you.

Likes

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
Reply
Loading...
Oct 01, 2019 0
Adobe Community Professional ,
Oct 01, 2019

Copy link to clipboard

Copied

Another suggestion:

 

<!--- Construction et écriture du PDF --->
<CFDOCUMENT format="PDF"
filename="MyPDF.pdf"
overwrite="Yes">
<cfoutput >
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">#CRLF# 
	<html>#CRLF#  
	<head>#CRLF#  
	<title>Les aventures de l'extrème</title>#CRLF#  
	</head>#CRLF#  
	<body>#CRLF# 
	<p style="text-align: center;"><br /></p>#CRLF#
	<p style="text-align: center;"><br /></p>#CRLF#
	<p style="text-align: center;"><br /></p>#CRLF#
	<cfdocumentitem type="pagebreak"/>
    <p><br /></p>#CRLF#
    <p style="text-align: center;">Albert Dupontel</p>#CRLF#
  	<p><br /></p>#CRLF#
  	<p><br /></p>#CRLF#
  	<h1 style="text-align: center;"><h1>Les aventures de l'extrème</h1>#CRLF#
  	<p><br /></p>#CRLF#
  	<p><br /></p>#CRLF#
  	<p><br /></p>#CRLF#
  	<p><br /></p>#CRLF#
	<cfdocumentitem type="pagebreak"/>
	<p><br /></p>#CRLF#
	<p><br /></p>#CRLF#
	<p style="text-align: center;"><br /></p>#CRLF#
	<p style="text-align: center;"><br /></p>#CRLF#
  	<p style="text-align: center;">Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>#CRLF#
  	<p style="text-align: center;">Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>#CRLF# 
	<p style="text-align: center;">que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>#CRLF# 
	<p style="text-align: center;">une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>#CRLF#
	<p style="text-align: center;"> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>#CRLF#
  	<p style="text-align: center;"><br /></p>#CRLF#
  	<p style="text-align: center;">&copy; Albert Dupontel</p>#CRLF#
 	<p style="text-align: center;">D&eacute;pot l&eacute;gal : #DateFormat(Now(),"YYYY-MM-DD")#</p>#CRLF#
	<cfdocumentitem type="pagebreak"/>
	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
  	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
  	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
  	<p class="reference" style="text-align: center;">Adaptation e-book : #DateFormat(Now(),"YYYY-MM-DD")#</p>#CRLF#
	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
  	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
  	<p class="reference" style="text-align: center;"><u><a href="http://Abertdupontel@hotmail.com/">Abert Dupontel</a></u></p>#CRLF#
	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
  	<p class="reference" style="text-align: center;"><br /></p>#CRLF#
	<cfdocumentitem type="pagebreak"/>
	<h2>Avertissement</h2>#CRLF#
	Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé, ainsi que les lieux. Bien sûr les dialogues sont inventés, les situations imaginées, les sentiments romancés.
#CRLF#
	</body>#CRLF#
	</html>#CRLF#
</cfoutput>
</CFDOCUMENT>

<cfheader name="Content-Disposition"
value="attachment;filename=MyPDF.pdf">
<cfcontent type="application/PDF"
file="#expandpath('MyPDF.pdf')#"
deletefile="YES"> <!--- Efface le fichier --->

 

Likes

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
Reply
Loading...
Oct 01, 2019 0
Participant ,
Oct 02, 2019

Copy link to clipboard

Copied

Bonjour

Voici où j'en suis !  j'ai toujours le message d'erreur et je ne peux ouvrir le PDF

<HTML>
<HEAD>
	<CFOUTPUT>
	<cfset CRLF =#chr(10)#>
	<CFINCLUDE template="../inc_init_admin.cfm">
	<CFINCLUDE template="../inc_verif_var2.cfm">
	<cfset DIR=#db_dir# & "SoLivres" & "/" &"_ebooks" & "/" &"SoLivres" & "/" &"IRLES" & "/" & "Le dernier secret de Julie Finet">
	</CFOUTPUT>
</HEAD>

<BODY>
	<CFOUTPUT>
	<!--- parser pour accentués et autres --->
	<cfset Titre="Le dernier secret de l'enfer">
	<CFIF trim(Titre) IS NOT "">
		<cfset chr=#Titre#>
		<CFINCLUDE template="../inc_parser.cfm">
		<cfset Titre=#chr#>
	</CFIF>
	
	
	<cfset CRLF =#chr(10)#>	
	<!--- Debut de la memorisation des informations dans C --->
	<CFDOCUMENT format="PDF"
		filename="MyPDF.pdf"
		overwrite="Yes">
		<cfoutput>

	<cfset C=""> 
	<cfset C=C & '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'& CRLF> 
	<cfset C=C & '<html>'& CRLF>  
	<cfset C=C & '<body>'& CRLF>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & CRLF>
	<cfset C=C & '<p style="text-align: center;"><br /></p>'& CRLF>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & CRLF>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
    <cfset C=C & '<p><br /></p>'& CRLF>
    <cfset C=C & '<p style="text-align: center;">Albert Dupontel</p>'& CRLF>
  	<cfset C=C & '<p><br /></p>'& CRLF>
  	<cfset C=C & '<p><br /></p>'& CRLF>
  	<cfset C=C & '<h1 style="text-align:center;">#Titre#</h1>'& CRLF>
  	<cfset C=C & '<p><br /></p>'& CRLF>
  	<cfset C=C & '<p><br /></p>'& CRLF>
  	<cfset C=C & '<p><br /></p>'& CRLF>
  	<cfset C=C & '<p><br /></p>'& CRLF>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<p><br /></p>' & CRLF>
	<cfset C=C & '<p><br /></p>' & CRLF>
	<cfset C=C & '<p style="text-align: center;"><br /></p>'& CRLF>
	<cfset C=C & '<p style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p style="text-align: center;">Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>' & CRLF>
  	<cfset C=C & '<p style="text-align: center;">Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>' & CRLF> 
	<cfset C=C & '<p style="text-align: center;">que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>' & CRLF> 
	<cfset C=C & '<p style="text-align: center;">une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>' & CRLF>
	<cfset C=C & '<p style="text-align: center;"> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>' & CRLF>
  	<cfset C=C & '<p style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p style="text-align: center;">&copy; Albert Dupontel</p>' & CRLF>
 	<cfset C=C & '<p style="text-align: center;">D&eacute;pot l&eacute;gal : #DateFormat(Now(),"DD-MM-YYYY")#</p>' & CRLF>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p class="reference" style="text-align: center;">Adaptation e-book : #DateFormat(Now(),"DD-MM-YYYY")#</p>' & CRLF>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><u><a href="http://Abertdupontel@hotmail.com/">Abert Dupontel</a></u></p>' & CRLF>
	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
  	<cfset C=C & '<p class="reference" style="text-align: center;"><br /></p>' & CRLF>
	<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
	<cfset C=C & '<h2>Avertissement</h2>'& CRLF>
	<cfset C=C & 'Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé, ainsi que les lieux. Bien sûr les dialogues sont inventés, les situations imaginées, les sentiments romancés.
'& CRLF>
	<cfset C=C & '</body>'& CRLF>
	<cfset C=C & '</html>'& CRLF>

			
	<!---  Construction et affichage du PDF --->
<!--- 	<CFDOCUMENT format="PDF" 
				filename="MyPDF.pdf" 
				overwrite="Yes">
				<cfoutput>#C#</cfoutput>--->
	</cfoutput>			
	</CFDOCUMENT> 
	
	<cfheader name="Content-Disposition" 
		      value="attachment;filename=MyPDF.pdf"> 
	<cfcontent type="application/PDF"
			   file="#DIR#/MyPDF.pdf"> 

	<!---  Ecriture du PDF --->
	<CFFILE action="WRITE" 
			file="#DIR#/MyPDF.pdf"  
			output="#C#">   
	</CFOUTPUT>		

Fini

Voici le message d'erreur :

cfdocument tag has no body. 
It must have a body or a source file or URL. 
 
The error occurred in D:\wwwroot\Hosting\H003\www\Admin\_ebooks\Livres_Create_PDFb_inc.cfm: line 83
81 : '& CRLF>
82 : 	<cfset C=C & '</body>'& CRLF>
83 : 	<cfset C=C & '</html>'& CRLF>
84 : 
85 : 	

Je ne peux vous joindre l'epub car ce site le refuse. Si j'ai un email, je pourrais vous le faire parvenir car je ne peux l'ouvrir.

Merci pour votre aide.

Likes

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
Reply
Loading...
Oct 02, 2019 0
Adobe Community Professional ,
Oct 04, 2019

Copy link to clipboard

Copied

ZNB, I shall now stop giving you suggestions for 3 reasons.

(1) You fail to respond to any questions that Forum members ask you.

(2) You fail to tell the Forum whether or not you applied the suggestions given to you, and what the result was.

(3) You stubbornly continue changing the code, in your own way, ignoring the suggestions of the Forum.

Likes

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
Reply
Loading...
Oct 04, 2019 0
Participant ,
Oct 04, 2019

Copy link to clipboard

Copied

Bonjour. Je ne comprends pas vos remarques :

Likes

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
Reply
Loading...
Oct 04, 2019 0
Adobe Community Professional ,
Oct 05, 2019

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Oct 05, 2019 0
LEGEND ,
Oct 04, 2019

Copy link to clipboard

Copied

Bonjour, ZNB,

 

Supprimez tous les hashtags ne figurant pas entre guillemets ou faisant partie d'une chaîne. <cfset CRLF = chr (13) & chr (10) /> (sauf si vous travaillez sur CF installé sur un système Linux, il ne s'agit que de chr (10).)

<cfset C & = "nouveau contenu" /> est identique à <cfset C = C & "nouveau contenu" />. Moins de code.

N'utilisez pas CFDOCUMENT pour ce faire. Vous devez d'abord l'enregistrer sur le disque, et cela ne fonctionne pas bien pour vous. Utilisez <cfsavecontent variable = "C"> VOTRE CONTENU ICI </ cfsavecontent>

Ce qui suit devrait être les dernières lignes de code sur le document .cfm. TOUT après il est ignoré.

 <cfheader name="Content-Disposition"
value="attachment;filename=MyPDF.pdf">
<cfcontent type="application/PDF"
variable="#C#" reset="yes">

 

This will make the PDF available to the user for download or opening.  Prior to the above code, use CFMAIL and attach the PDF to an email and send it to yourself.

 

<cfmail from="you" to="you" subject="New PDF created">

    <cfmailparam file="#C#" />

</cfmail>

 

V/r,

 

^ _ ^

 

Likes

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
Reply
Loading...
Oct 04, 2019 1
Adobe Community Professional ,
Oct 05, 2019

Copy link to clipboard

Copied

J'aime bien, WolfShade. 🙂

Likes

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
Reply
Loading...
Oct 05, 2019 0
LEGEND ,
Oct 07, 2019

Copy link to clipboard

Copied

Merci, BKBK. 🙂

Likes

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
Reply
Loading...
Oct 07, 2019 1
Participant ,
Oct 17, 2019

Copy link to clipboard

Copied

Help

Likes

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
Reply
Loading...
Oct 17, 2019 0
Participant ,
Oct 08, 2019

Copy link to clipboard

Copied

Suite à ton message, voici mon code et mes observations :

Following your message, here is my code and my comments:

 

<cfset CRLF = chr (13) & chr (10) />
	<!--- Debut de la memorisation des informations dans C --->
	<!--- <cfsavecontent variable = "C"> --->
		<cfset C="">
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<!--- <cfset C & = '<cfdocumentitem type="pagebreak"/>'> --->
		<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<h2 style="text-align: center;">Albert Dupontel</h2>'& CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<h1 style="text-align:center;">#Titre#</h1>'& CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;">Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;">Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>' & CRLF> 
		<cfset C=C & '<p style="text-align: center;">que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>' & CRLF> 
		<cfset C=C & '<p style="text-align: center;">une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;"> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;"><br /></p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;">&copy; Albert Dupontel</p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;">D&eacute;pot l&eacute;gal : #DateFormat(Now(),"DD-MM-YYYY")#</p>' & CRLF>
		<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;">Adaptation e-book : #DateFormat(Now(),"DD-MM-YYYY")#</p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p style="text-align: center;"><u><a href="http://Abertdupontel@hotmail.com/">Abert Dupontel</a></u></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<p><br /></p>' & CRLF>
		<cfset C=C & '<cfdocumentitem type="pagebreak"/>'>
		<cfset C=C & '<h2>Avertissement</h2>'& CRLF>
		<cfset C=C & 'Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
	Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé, ainsi que les lieux. Bien sûr les dialogues sont inventés, les situations imaginées, les sentiments romancés.
	'& CRLF>
	<!--- </cfsavecontent> --->	


	c : #c# 


	<!---  Construction et affichage du PDF --->
	<!--- <CFDOCUMENT format="PDF" 
				filename="MyPDF.pdf" 
				overwrite="Yes">
				<cfoutput>#C#</cfoutput>
	</CFDOCUMENT>  --->

					
	<!--- <cfheader name="Content-Disposition"
				value="attachment;filename=MyPDF.pdf">
	<cfcontent type="application/PDF"
				variable="#C#" 
				reset="yes"> 	 --->	 
</CFOUTPUT>	 

 

1 - le système plante quand j'emploie : <cfset C & = ....

2 - Quand j'emploie cfsavecontent, l'affichage de C ne se fait plus.

3 -  cfheader ne génère pas de message de téléchargement

4 - Vous aviez raison, cela ne sert à rien d'enregister le PDF, puisqu'on peut le regénérer à tout moment.

Merci de votre aide et de votre éclairage.

 

1 - the system crashes when I use : <cfset C & = ...

2 - When I use cfsavecontent, the display of C is no longer done.

3 - cfheader does not generate a download message.

4 - You where right, there is no point in registering the PDF, since it can be generated at any time.

Tank you for help and your ligting

Likes

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
Reply
Loading...
Oct 08, 2019 0
Participant ,
Oct 15, 2019

Copy link to clipboard

Copied

HELP

Likes

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
Reply
Loading...
Oct 15, 2019 0
LEGEND ,
Oct 17, 2019

Copy link to clipboard

Copied

Bonjour,

 

1 - the system crashes when I use : <cfset C & = ...

You need to use <cfset C &= ... with no space between the & and the =.  CF does not understand <cfset C & =..  Sorry, that was done by Google Translate.

 

2 - When I use cfsavecontent, the display of C is no longer done.

<cfsavecontent variable="C"> Your content here </cfsavecontent> will create a variable called "C" and place within it whatever content you put between the <cfsavecontent> and </cfsavecontent>.  Did you use 'variable="C"' attribute?

 

3 - cfheader does not generate a download message.

cfheader, if used properly, should prompt the user to either open or download and save the PDF.  If it isn't prompting, something is wrong with your code.  Check CFAdmin logs, and the browser console, to see if anything is being reported.

 

The cfsavecontent should be first, then the cfheader/cfcontent tags.  If you want a copy of the PDF, use cfmail to send it to your email address, but it must be used _after_ the cfsavecontent tags and _before_ the cfheader/cfcontent tags.  Anything after cfheader/cfcontent is ignored.

 

I'm doing a search of my projects to find example code.  I'll post it, here, when I find it.

 

V/r,

 

^ _ ^

Likes

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
Reply
Loading...
Oct 17, 2019 0
Participant ,
Oct 28, 2019

Copy link to clipboard

Copied

Bonjour,

Je n'ai pas eu le temps de m'en occuper plus tôt. Pardon !

J'ai suivi vos instructions et cela fonctione 😉

Voici mon code :

Hello,

I did not have time to deal with it sooner. Sorry !

I followed your instructions and it works 😉

Here is my code:

<cfset CRLF = chr (13) & chr (10) />
	<!--- Debut de la memorisation des informations dans C --->
		<cfset C="">
		<cfset C=C& "<p><html></p>" & CRLF>
		<cfset C=C& "<p><body></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& '<p align=center><IMG src="#DIRI#\Couv.jpg" border="0" align="top"></p>'& #CRLF#>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<cfdocumentitem type='pagebreak'/>">
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<cfdocumentitem type='pagebreak'/>">
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<h2 align=center>#Auteur#</h2>"& CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<h1 align=center>#Titre#</h1>"& CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<cfdocumentitem type='pagebreak'/>">
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& '<p align=center><IMG src="SoLivres.jpg" border="0" align="top"></p>'& #CRLF#>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'><a href='http://info@solivres.com/'>www. solivres.com</a>"& #CRLF#>
		<cfset C=C& "<p style='text-align: center;'>Adaptation e-book #DateFormat(Now(),'DD-MM-YYYY')#"& #CRLF#>
		<cfset C=C& "<cfdocumentitem type='pagebreak'/>">
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'>Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'>Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>" & CRLF> 
		<cfset C=C& "<p style='text-align: center;'>que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>" & CRLF> 
		<cfset C=C& "<p style='text-align: center;'>une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'><br /></p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'>&copy; #Auteur#</p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'>D&eacute;pot l&eacute;gal : #DateFormat(Now(),'DD-MM-YYYY')#</p>" & CRLF>
		<cfset C=C& "<p style='text-align: center;'><u>Email : <a href='http://JeanMarcIRLES@hotmail.com/'>#Auteur#</a></u></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<cfdocumentitem type='pagebreak'/>">
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<h2>#ChapitresTitle#</h2>"& CRLF>
		<cfset C=C& "<p>#ChapitresTexte#</p>"& CRLF> 
		<cfset C=C& "<p></body></p>" & CRLF>
		<cfset C=C& "<p></html></p>" & CRLF>

	<!--- Construction et affichage du PDF ---> 
	<CFDOCUMENT
			FORMAT="PDF" 
			filename="#DIR#/MyPDF.pdf" 
			overwrite="Yes">
			#C# 
	</CFDOCUMENT> 
	
	<!--- Ecriture du PDF ---> 
	<CFFILE action="WRITE" file="#DIR#/MyPDF.pdf" output="#C#">  
	
	<CFMAIL TO="jmbusselet@hotmail.com" 
			FROM="marc75paris@outlook.fr" 
			type="HTML" 
			SUBJECT="voici une copie"> 
			<cfmailparam file = "MyPDF.pdf" content ="#C#"/> 
		Veuillez trouvez ci-joint le pdf demandé
	</CFMAIL> 
	

<cfheadername="Content-Disposition" value="attachment;filename=MyPDF.pdf">

<!--- Affichage PDF --->
<cfcontent type="application/PDF" file="#DIR#/MyPDF.pdf" deletefile="No"> 

</CFOUTPUT> 
	
<BR>

Deux choses ne fonctionnent pas :

pagebreak

Le PDF n'est pas "construit" !  il n'y a que mon code:-(

Two things do not work:

pagebreak

The PDF is not "built"! there is only my code 😞

 

Likes

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
Reply
Loading...
Oct 28, 2019 0
LEGEND ,
Oct 28, 2019

Copy link to clipboard

Copied

CFDOCUMENTITEM pagebreak will not work because it is part of the string, and CF does not process it.  It just adds that code to the HTML that the PDF is generated from.

 

Glad you got it working, though.

 

V/r,

 

^ _ ^

Likes

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
Reply
Loading...
Oct 28, 2019 0
Adobe Community Professional ,
Oct 28, 2019

Copy link to clipboard

Copied

<cfset CRLF = chr (13) & chr (10) />
	<!--- Debut de la memorisation des informations dans C --->

		<cfset C="">
		<cfset C2="">
		<cfset C3="">
		<cfset C4="">
		<cfset C5="">
		<cfset C6="">
		
		<cfset C=C& "<p><html></p>" & CRLF>
		<cfset C=C& "<p><body></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& '<p align=center><IMG src="#DIRI#\Couv.jpg" border="0" align="top"></p>'& #CRLF#>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
					
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
	
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<h2 align=center>#Auteur#</h2>"& CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=3C& "<h1 align=center>#Titre#</h1>"& CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
	
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& '<p align=center><IMG src="SoLivres.jpg" border="0" align="top"></p>'& #CRLF#>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p style='text-align: center;'><a href='http://info@solivres.com/'>www. solivres.com</a>"& #CRLF#>
		<cfset C4=C4& "<p style='text-align: center;'>Adaptation e-book #DateFormat(Now(),'DD-MM-YYYY')#"& #CRLF#>

		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'>Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'>Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proC5&eacute;d&eacute;</p>" & CRLF> 
		<cfset C5=C5& "<p style='text-align: center;'>que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>" & CRLF> 
		<cfset C5=C5& "<p style='text-align: center;'>une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'><br /></p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'>&copy; #Auteur#</p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'>D&eacute;pot l&eacute;gal : #DateFormat(Now(),'DD-MM-YYYY')#</p>" & CRLF>
		<cfset C5=C5& "<p style='text-align: center;'><u>Email : <a href='http://JeanMarcIRLES@hotmail.com/'>#Auteur#</a></u></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>
		<cfset C5=C5& "<p><br /></p>" & CRLF>

		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<p><br /></p>" & CRLF>
		<cfset C6=C6& "<h2>#ChapitresTitle#</h2>"& CRLF>
		<cfset C6=C6& "<p>#ChapitresTexte#</p>"& CRLF> 
		<cfset C6=C6& "<p></body></p>" & CRLF>
		<cfset C6=C6& "<p></html></p>" & CRLF>
<CFOUTPUT> 
	<!--- Construction, affichage et écriture du PDF ---> 
	<CFDOCUMENT
			FORMAT="PDF" 
			filename="#DIR#/MyPDF.pdf" 
			overwrite="Yes">
			#C#
			<cfdocumentitem type='pagebreak'/> 
			#C2#
			<cfdocumentitem type='pagebreak'/> 
			#C3#
			<cfdocumentitem type='pagebreak'/> 
			#C4#
			<cfdocumentitem type='pagebreak'/> 
			#C5#
			<cfdocumentitem type='pagebreak'/> 
			#C6# 
	</CFDOCUMENT> 
	
	<CFMAIL TO="jmbusselet@hotmail.com" 
			FROM="marc75paris@outlook.fr" 
			type="HTML" 
			SUBJECT="voici une copie"> 
			<cfmailparam file = "#DIR#/MyPDF.pdf"/> 
		Veuillez trouvez ci-joint le pdf demandé
	</CFMAIL> 

<cfheader name="Content-Disposition" value="attachment;filename=MyPDF.pdf">

<!--- Affichage PDF --->
<cfcontent type="application/PDF" file="#DIR#/MyPDF.pdf" deletefile="No"> 

</CFOUTPUT> 

Likes

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
Reply
Loading...
Oct 28, 2019 0
Adobe Community Professional ,
Oct 28, 2019

Copy link to clipboard

Copied

Code inutile:

<CFFILE action="WRITE" file="#DIR#/MyPDF.pdf" output="#C#">  

 Pièce jointe:

<cfmailparam file = "#DIR#/MyPDF.pdf"/>

Likes

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
Reply
Loading...
Oct 28, 2019 0
Participant ,
Oct 30, 2019

Copy link to clipboard

Copied

Bonjour,

Tout est parfait sauf que ... je ne peux ouvrir le PDF.

J'ai le message suivant :

"Nous n’avons pas pu ouvrir le PDF

Un problème empêche l’ouverture de ce PDF."

Quand j'examine le PDF en le mettant en .txt, pas de transformation ! juste mon code

Merci pour votre aide si précieuse 

 

Hello,
Everything is perfect except that ... I can not open the PDF.
I have the following message:
"We could not open the PDF
A problem prevents the opening of this PDF".
When I examine the PDF by putting it in .txt, no transformation! just my code
Thank you for your help so precious

 

Likes

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
Reply
Loading...
Oct 30, 2019 0
Participant ,
Nov 04, 2019

Copy link to clipboard

Copied

Bonjour,

Pas de solutions ?

Dommage de créer un PDF et ne pouvoir le lire.

Merci par avance pour votre aide.

 

Hello,
No solutions?
Too bad to create a PDF and not being able to read it.
Thank you in advance for your help.

 

Likes

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
Reply
Loading...
Nov 04, 2019 0
Adobe Community Professional ,
Nov 04, 2019

Copy link to clipboard

Copied

When I use your code, the PDF file can be opened without any problem.

Please show us the exact code that you're currently using.

Likes

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
Reply
Loading...
Nov 04, 2019 0
Participant ,
Nov 09, 2019

Copy link to clipboard

Copied

Bonjour,

Voici le code que j'utilise :

Hello,

Here is the code I use : 

 

 

<HTML>
<! DOCTYPE html /> 
<HEAD>
	<CFOUTPUT>
	<CFINCLUDE template="../inc_init_admin.cfm">
	<CFINCLUDE template="../inc_verif_var2.cfm"> 
	<cfset Auteur="Jean-Marc IRLES"> 
	<cfset Titre="Le dernier secret de Julie Finet">
	<cfset ChapitresTitle="Avertissement">
	<cfset ChapitresTexte="Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
	Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé ainsi que les lieux. Bien sûr, les dialogues sont inventés, les situations imaginées, les sentiments romancés.">
	<cfset DIR=#db_dir# & "SoLivres" & "\" &"_Ebooks" & "\" &"SoLivres" & "\" &"#Auteur#" & "\" & "#Titre#">
	<cfset DIRI="..\..\..\" & "SoLivres"& "\" &"_Ebooks" & "\" &"SoLivres" & "\" &"#Auteur#" & "\" & "#Titre#" & "\" & "images">
<!--- 	DIR : #DIR#<BR>
	DIRI : #DIRI#<BR> --->
	</CFOUTPUT>
</HEAD>

 <BODY>
	<CFOUTPUT>
	<!--- parser pour accentués et autres --->
	<CFIF trim(Auteur) IS NOT "">
		<cfset chr=#Auteur#>
		<CFINCLUDE template="../inc_parser.cfm">
		<cfset Auteur=#chr#>
	</CFIF>

	<CFIF trim(Titre) IS NOT "">
		<cfset chr=#Titre#>
		<CFINCLUDE template="../inc_parser.cfm">
		<cfset Titre=#chr#>
	</CFIF> 
	
	
	
	<cfset CRLF = chr (13) & chr (10) />
	<!--- Debut de la memorisation des informations dans C --->
		<cfset C="">
		<cfset C1="">
		<cfset C2="">
		<cfset C3="">
		<cfset C4="">

		<cfset C=C& "<p><html></p>" & CRLF>
		<cfset C=C& "<p><body></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& '<p align=center><IMG src="#DIRI#\Couv.jpg" border="0" align="top"></p>'& #CRLF#>
		
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<h2 align=center>#Auteur#</h2>"& CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<h1 align=center>#Titre#</h1>"& CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
        <cfset C1=C1& '<p align=center><IMG src="SoLivres.jpg" border="0" align="top"></p>'& #CRLF#>
		
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& '<p align=center><IMG src="SoLivres.jpg" border="0" align="top"></p>'& #CRLF#>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p style='text-align: center;'><a href='http://info@solivres.com/'>www. solivres.com</a>"& #CRLF#>
		<cfset C2=C2& "<p style='text-align: center;'>Adaptation e-book #DateFormat(Now(),'DD-MM-YYYY')#"& #CRLF#>

		
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>" & CRLF> 
		<cfset C3=C3& "<p style='text-align: center;'>que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>" & CRLF> 
		<cfset C3=C3& "<p style='text-align: center;'>une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'><br /></p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>&copy; #Auteur#</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>D&eacute;pot l&eacute;gal : #DateFormat(Now(),'DD-MM-YYYY')#</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'><u>Email : <a href='http://JeanMarcIRLES@hotmail.com/'>#Auteur#</a></u></p>" & CRLF>
		
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<h2>#ChapitresTitle#</h2>"& CRLF>
		<cfset C4=C4& "<p>#ChapitresTexte#</p>"& CRLF> 
		<cfset C4=C4& "<p></body></p>" & CRLF>
		<cfset C4=C4& "<p></html></p>" & CRLF>



	<!--- Construction et affichage du PDF ---> 
	<CFDOCUMENT
			FORMAT="PDF" 
			filename="#DIR#/MyPDF.pdf" 
			overwrite="Yes">
			#C#
			<cfdocumentitem type='pagebreak'/> 
			#C2#
			<cfdocumentitem type='pagebreak'/> 
			#C3#
			<cfdocumentitem type='pagebreak'/> 
			#C4#
	</CFDOCUMENT> 
	
	<!--- Ecriture du PDF ---> 
	<CFFILE action="WRITE" file="#DIR#/MyPDF.pdf" output="#C#">  
	
	<CFMAIL TO="jmbusselet@hotmail.com" 
			FROM="marc75paris@outlook.fr" 
			type="HTML" 
			SUBJECT="voici une copie"> 
			<cfmailparam file = "#DIR#/MyPDF.pdf"/> 
		Veuillez trouvez ci-joint le pdf demandé
	</CFMAIL> 
	
<!--- Affichage PDF --->
<cfheader name="Content-Disposition" value="attachment;filename=MyPDF.pdf"> 
<cfcontent type="application/PDF" file="#DIR#/MyPDF.pdf" deletefile="No">  

</CFOUTPUT> 
	
<BR>
Fini

 

Merci pour votre aide.

Thanks for your help

Likes

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
Reply
Loading...
Nov 09, 2019 0
Adobe Community Professional ,
Nov 09, 2019

Copy link to clipboard

Copied

There are problems in this code:

1) The HTML tags are not part of the PDF content; they should be.

2) <cffile action="write"> is unnecessary. I have said this at least 3 times!

3) You have brought back #CRLF# even though you were advised on several occasions to replace it with CRLF.

Likes

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
Reply
Loading...
Nov 09, 2019 0
Adobe Community Professional ,
Nov 09, 2019

Copy link to clipboard

Copied

Suggestions:

1) Delete unneccessary # symbols.

2) Delete the cffile-write tag. It is unncessary because cfdocument writes the file.

3) Use cfsavecontent to group the code at the top into a variable called docIntro.

4) Include the contents of C1 in the cfdocument tag.

5) Remove the tags <html>, <body> from the original definition of  the variable C. That is because you have introduced a new set of tags <html> and <body> above.

Initialize C with: 

 

<cfset C=docIntro>

 

 

<cfsavecontent variable="docIntro" >
<HTML>
<! DOCTYPE html /> 
<HEAD>
	<CFINCLUDE template="../inc_init_admin.cfm">
	<CFINCLUDE template="../inc_verif_var2.cfm"> 
	<cfset Auteur="Jean-Marc IRLES"> 
	<cfset Titre="Le dernier secret de Julie Finet">
	<cfset ChapitresTitle="Avertissement">
	<cfset ChapitresTexte="Ce livre raconte une enquête policière étrange. C’est aussi une histoire romancée de mes ascendants. Julie de Bozonnier de Vaumane a réellement vécu. Elle est mon arrière-grand-mère paternelle.
	Tous les événements historiques relatés dans les pages que vous allez lire sont réels. Les personnages ont existé ainsi que les lieux. Bien sûr, les dialogues sont inventés, les situations imaginées, les sentiments romancés.">
	<cfset DIR=db_dir & "SoLivres" & "\" & "_Ebooks" & "\" & "SoLivres" & "\" & Auteur & "\" & Titre >
	<cfset DIRI="..\..\..\" & "SoLivres" & "\" & "_Ebooks" & "\" & "SoLivres" & "\" & Auteur & "\" & Titre & "\" & "images">
<!--- 	DIR : #DIR#<BR>
	DIRI : #DIRI#<BR> --->
</HEAD>

 <BODY>
	<!--- parser pour accentués et autres --->
	<CFIF trim(Auteur) IS NOT "">
		<cfset chr=Auteur>
		<CFINCLUDE template="../inc_parser.cfm">
		<cfset Auteur=chr>
	</CFIF>

	<CFIF trim(Titre) IS NOT "">
		<cfset chr=Titre>
		<CFINCLUDE template="../inc_parser.cfm">
		<cfset Titre=chr>
	</CFIF> 
</cfsavecontent>

	
	
	<cfset CRLF = chr (13) & chr (10) />
	
<CFOUTPUT>
	<!--- Debut de la memorisation des informations dans C --->
		<cfset C=docIntro>
		<cfset C1="">
		<cfset C2="">
		<cfset C3="">
		<cfset C4="">
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& "<p><br /></p>" & CRLF>
		<cfset C=C& '<p align=center><IMG src="#DIRI#\Couv.jpg" border="0" align="top"></p>'& CRLF>
		
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<h2 align=center>#Auteur#</h2>"& CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<h1 align=center>#Titre#</h1>"& CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
		<cfset C1=C1& "<p><br /></p>" & CRLF>
        <cfset C1=C1& '<p align=center><IMG src="SoLivres.jpg" border="0" align="top"></p>'& CRLF>
		
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& '<p align=center><IMG src="SoLivres.jpg" border="0" align="top"></p>'& CRLF>
		<cfset C2=C2& "<p><br /></p>" & CRLF>
		<cfset C2=C2& "<p style='text-align: center;'><a href='http://info@solivres.com/'>www. solivres.com</a>"& CRLF>
		<cfset C2=C2& "<p style='text-align: center;'>Adaptation e-book #DateFormat(Now(),'DD-MM-YYYY')#"& CRLF>

		
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p><br /></p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>Le code de propri&eacute;t&eacute; intellectuelle interdit les copies ou reproductions destin&eacute;es&nbsp;&agrave;&nbsp; une utilisation collective.</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>Toute reproduction ou repr&eacute;sentation int&eacute;grale ou partielle faite par quelque proc&eacute;d&eacute;</p>" & CRLF> 
		<cfset C3=C3& "<p style='text-align: center;'>que ce soit sans le consentement des auteurs ou de ses ayants droit ou ayants cause est illicite et constitue</p>" & CRLF> 
		<cfset C3=C3& "<p style='text-align: center;'>une contre fa&ccedil;on, au terme des paragraphes 2 et 3 des articles 22_5,</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'> L 122_4, L 335_2 et suivant du Code de la propri&eacute;t&eacute; intellectuelle.</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'><br /></p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>&copy; #Auteur#</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'>D&eacute;pot l&eacute;gal : #DateFormat(Now(),'DD-MM-YYYY')#</p>" & CRLF>
		<cfset C3=C3& "<p style='text-align: center;'><u>Email : <a href='http://JeanMarcIRLES@hotmail.com/'>#Auteur#</a></u></p>" & CRLF>
		
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<p><br /></p>" & CRLF>
		<cfset C4=C4& "<h2>#ChapitresTitle#</h2>"& CRLF>
		<cfset C4=C4& "<p>#ChapitresTexte#</p>"& CRLF> 
		<cfset C4=C4& "<p></body>" & CRLF>
		<cfset C4=C4& "<p></html>" & CRLF>



	<!--- Construction et affichage du PDF ---> 
	<CFDOCUMENT
			FORMAT="PDF" 
			filename="#DIR#/MyPDF.pdf" 
			overwrite="Yes">
			#C#
                        #C1#
			<cfdocumentitem type='pagebreak'/> 
			#C2#
			<cfdocumentitem type='pagebreak'/> 
			#C3#
			<cfdocumentitem type='pagebreak'/> 
			#C4#
	</CFDOCUMENT> 
	
	<CFMAIL TO="jmbusselet@hotmail.com" 
			FROM="marc75paris@outlook.fr" 
			type="HTML" 
			SUBJECT="voici une copie"> 
			<cfmailparam file = "#DIR#/MyPDF.pdf"/> 
		Veuillez trouvez ci-joint le pdf demandé
	</CFMAIL> 
	
<!--- Affichage PDF --->
<cfheader name="Content-Disposition" value="attachment;filename=MyPDF.pdf"> 
<cfcontent type="application/PDF" file="#DIR#/MyPDF.pdf" deletefile="No">  

</CFOUTPUT> 

 

 

Likes

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
Reply
Loading...
Nov 09, 2019 0
Participant ,
Nov 19, 2019

Copy link to clipboard

Copied

Bonjour,

Je voulais vous remercier tous (et surtout BKBK) pour votre aide et pour votre ... patience.

J'ai appris beaucoup de choses.

Encore merci

Cordialement

 

Hello,

I wanted to thank you all (and especially BKBK) for your help and for your ... patience.

I learned a lot of things.

Thanks again

Cordially

Likes

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
Reply
Loading...
Nov 19, 2019 1