Click here to Skip to main content
15,867,308 members
Home / Discussions / C#
   

C#

 
Questionusing c# to copy files from clients to main server Pin
coderz322-Jul-19 12:34
coderz322-Jul-19 12:34 
AnswerRe: using c# to copy files from clients to main server Pin
BillWoodruff2-Jul-19 15:35
professionalBillWoodruff2-Jul-19 15:35 
QuestionHttpException Pin
indra160230-Jun-19 18:50
indra160230-Jun-19 18:50 
AnswerRe: HttpException Pin
Richard Deeming1-Jul-19 0:56
mveRichard Deeming1-Jul-19 0:56 
Questionexception for httpTransportBindingElement Pin
indra160230-Jun-19 17:46
indra160230-Jun-19 17:46 
AnswerRe: exception for httpTransportBindingElement Pin
#realJSOP2-Jul-19 2:46
mve#realJSOP2-Jul-19 2:46 
QuestionHTML to PDF conversion Pin
Member 1164896329-Jun-19 23:59
Member 1164896329-Jun-19 23:59 
AnswerRe: HTML to PDF conversion Pin
OriginalGriff30-Jun-19 1:53
mveOriginalGriff30-Jun-19 1:53 
Assuming this is iTestSharp you are using, not IText:
C#
string htmlText = File.ReadAllText(@"D:\Test Data\APage.html");
using (MemoryStream stream = new System.IO.MemoryStream())
    {
    using (StringReader sr = new StringReader(htmlText))
        {
        using (Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f))
            {
            using (PdfWriter writer = PdfWriter.GetInstance(pdfDoc, stream))
                {
                pdfDoc.Open();
                XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, sr);
                pdfDoc.Close();
                File.WriteAllBytes(@"D:\Test Data\APage.pdf", stream.ToArray());
                }
            }
        }
    }
Provided your HTML is well formed, that should work fine.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

QuestionFinding many locations of a Bitmap contained inside another Bitmap Pin
IELTS for Beginners29-Jun-19 0:41
IELTS for Beginners29-Jun-19 0:41 
AnswerRe: Finding many locations of a Bitmap contained inside another Bitmap Pin
OriginalGriff29-Jun-19 0:46
mveOriginalGriff29-Jun-19 0:46 
AnswerRe: Finding many locations of a Bitmap contained inside another Bitmap Pin
Richard MacCutchan29-Jun-19 7:24
mveRichard MacCutchan29-Jun-19 7:24 
AnswerRe: Finding many locations of a Bitmap contained inside another Bitmap Pin
BillWoodruff29-Jun-19 19:05
professionalBillWoodruff29-Jun-19 19:05 
QuestionMessage Closed Pin
28-Jun-19 12:37
Member 1451570728-Jun-19 12:37 
SuggestionRe: to Pin
Eddy Vluggen28-Jun-19 13:43
professionalEddy Vluggen28-Jun-19 13:43 
AnswerRe: to Pin
BillWoodruff28-Jun-19 15:16
professionalBillWoodruff28-Jun-19 15:16 
AnswerRe: to Pin
Dave Kreskowiak28-Jun-19 17:30
mveDave Kreskowiak28-Jun-19 17:30 
AnswerRe: to Pin
OriginalGriff28-Jun-19 19:14
mveOriginalGriff28-Jun-19 19:14 
GeneralRe: to Pin
Member 1451570728-Jun-19 21:56
Member 1451570728-Jun-19 21:56 
GeneralRe: to Pin
OriginalGriff28-Jun-19 22:09
mveOriginalGriff28-Jun-19 22:09 
RantRe: to Pin
Eddy Vluggen29-Jun-19 1:04
professionalEddy Vluggen29-Jun-19 1:04 
AnswerRe: to Pin
Gerry Schmitz29-Jun-19 2:36
mveGerry Schmitz29-Jun-19 2:36 
QuestionLINQ : Unmatched data is coming for inner join Pin
Mou_kol28-Jun-19 9:39
Mou_kol28-Jun-19 9:39 
AnswerRe: LINQ : Unmatched data is coming for inner join Pin
Eddy Vluggen28-Jun-19 13:44
professionalEddy Vluggen28-Jun-19 13:44 
GeneralRe: LINQ : Unmatched data is coming for inner join Pin
Mou_kol1-Jul-19 5:04
Mou_kol1-Jul-19 5:04 
GeneralRe: LINQ : Unmatched data is coming for inner join Pin
Eddy Vluggen1-Jul-19 5:08
professionalEddy Vluggen1-Jul-19 5:08 

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.