Click here to Skip to main content
15,846,006 members
Home / Discussions / C#
   

C#

 
Questionseparate compound color planes Pin
nhocclever14-Nov-13 20:16
nhocclever14-Nov-13 20:16 
AnswerRe: separate compound color planes Pin
Pete O'Hanlon14-Nov-13 20:36
subeditorPete O'Hanlon14-Nov-13 20:36 
GeneralRe: separate compound color planes Pin
harold aptroot14-Nov-13 22:14
harold aptroot14-Nov-13 22:14 
GeneralRe: separate compound color planes Pin
nhocclever17-Nov-13 17:06
nhocclever17-Nov-13 17:06 
GeneralRe: separate compound color planes Pin
harold aptroot17-Nov-13 22:06
harold aptroot17-Nov-13 22:06 
GeneralRe: separate compound color planes Pin
nhocclever19-Nov-13 0:53
nhocclever19-Nov-13 0:53 
QuestionC# modify ssrs report property Pin
dcof14-Nov-13 11:41
dcof14-Nov-13 11:41 
QuestionConvert HTML to PDF Pin
NYCABR14-Nov-13 9:50
NYCABR14-Nov-13 9:50 
Hello,
I have html code that need to be converted to PDF by clicking on the button on the webpage.
Generated HTML contains table populated from the recordset.
Please check the code below. It is working, except for some reason in pdf it cuts out last row in the table.
C#
private void GenerateReport(string Html, HttpContext context)
        {
            MemoryStream stream = createPDF(Html);

            context.Response.ContentType = "application/pdf";
            context.Response.AddHeader("Content-Disposition", "attachment; filename=\"Report.pdf\"");
            context.Response.BinaryWrite(stream.ToArray());
       
        }

        private MemoryStream createPDF(string html)
        {
            MemoryStream msOutput = new MemoryStream();
            TextReader reader = new StringReader(html);

            Document document = new Document(PageSize.A4,10f,10f,10f,0f);
            
            PdfWriter writer = PdfWriter.GetInstance(document, msOutput);

            HTMLWorker worker = new HTMLWorker(document);
    
            document.Open();
            worker.StartDocument();

            worker.Parse(reader);
            worker.EndDocument();
            worker.Close();
            document.Close();

            return msOutput;
        }


If i run just html, all rows are displayed. The generated PDF document won't include last row.
Can't figure out why.
Any ideas would be appreciated.
Thanks.
QuestionThreading - Play / pause / stop question Pin
Mirko Jurcevic14-Nov-13 3:07
Mirko Jurcevic14-Nov-13 3:07 
AnswerRe: Threading - Play / pause / stop question Pin
Pete O'Hanlon14-Nov-13 3:28
subeditorPete O'Hanlon14-Nov-13 3:28 
GeneralRe: Threading - Play / pause / stop question Pin
Mirko Jurcevic14-Nov-13 3:33
Mirko Jurcevic14-Nov-13 3:33 
GeneralRe: Threading - Play / pause / stop question Pin
Pete O'Hanlon14-Nov-13 4:02
subeditorPete O'Hanlon14-Nov-13 4:02 
AnswerRe: Threading - Play / pause / stop question Pin
Ennis Ray Lynch, Jr.14-Nov-13 6:41
Ennis Ray Lynch, Jr.14-Nov-13 6:41 
QuestionConvert Datatable data into Json data in C# Pin
susanna.floora14-Nov-13 2:12
susanna.floora14-Nov-13 2:12 
AnswerRe: Convert Datatable data into Json data in C# Pin
V.14-Nov-13 3:04
professionalV.14-Nov-13 3:04 
AnswerRe: Convert Datatable data into Json data in C# Pin
Richard Deeming14-Nov-13 5:19
mveRichard Deeming14-Nov-13 5:19 
Question[Solved] Windows Service - problem with write file at scheduled time Pin
emma.sun.sts13-Nov-13 21:06
emma.sun.sts13-Nov-13 21:06 
AnswerRe: Windows Service - problem with write file at scheduled time Pin
Bernhard Hiller13-Nov-13 21:56
Bernhard Hiller13-Nov-13 21:56 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
emma.sun.sts13-Nov-13 22:25
emma.sun.sts13-Nov-13 22:25 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
Bernhard Hiller13-Nov-13 22:29
Bernhard Hiller13-Nov-13 22:29 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
emma.sun.sts13-Nov-13 22:39
emma.sun.sts13-Nov-13 22:39 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
Eddy Vluggen13-Nov-13 22:48
professionalEddy Vluggen13-Nov-13 22:48 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
Pete O'Hanlon14-Nov-13 1:14
subeditorPete O'Hanlon14-Nov-13 1:14 
Questionread only Pin
seeker6213-Nov-13 9:41
seeker6213-Nov-13 9:41 
SuggestionRe: read only Pin
Richard MacCutchan13-Nov-13 9:56
mveRichard MacCutchan13-Nov-13 9:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.