Click here to Skip to main content
15,901,505 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use pdfcrowd to convert html to pdf
C#
string[]  getval= new string{"1","2"};

I generate html code from foreach, so if foreach runs 2 times, i want to show both html code in different page in same pdf
C#
foreach(string val in getval)
{

    forpdf=forpdf+"<div>NEw cvalue is </div>"+val.ToString()+"";             

}

pdfcrowd.Client client = new pdfcrowd.Client("addgvsv", "bvabval753766");

MemoryStream Stream = new MemoryStream();
client.convertHtml(forpdf,Stream);


Response.AddHeader("Content-Disposition", "attachment; filename=Itinerary_1.pdf");

So , in generated pdf (Itinerary_1.pdf), there it should show in 1st page as

NEw cvalue is 1

in 2nd page , in same pdf ,

NEw cvalue is 2


pls advice
Posted
Updated 18-Feb-14 2:24am
v2

I think you'll need to save temporary pdf files and merge them.
Have a look there ;)
http://pdfcrowd.com/forums/read.php?3,666[^]
 
Share this answer
 
Comments
maulikshah1990 18-Feb-14 23:16pm    
can u give proper example in asp.net
Ahmed Bensaid 19-Feb-14 4:24am    
Continue to use PdfCrowd to convert html to pdf. Generate multiple temporary PDF files.
And then, merge them with this :
http://www.codeproject.com/Articles/28283/Simple-NET-PDF-Merger
In header i use
<head> P.pagebreakhere {page-break-before: always}</head>

and in body i use



where i want to end the page and start new page..

and this works...

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900