{"id":26534836,"url":"https://github.com/iron-software/iron-pdf-example-hello-world-csharp","last_synced_at":"2025-09-22T20:34:17.212Z","repository":{"id":76754687,"uuid":"149705698","full_name":"iron-software/iron-pdf-example-hello-world-csharp","owner":"iron-software","description":"Get started creating PDF documents in C# using IronPDF","archived":false,"fork":false,"pushed_at":"2023-04-19T08:32:57.000Z","size":1115,"stargazers_count":18,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T13:51:25.539Z","etag":null,"topics":["html-to-pdf","html5","ironpdf","pdf","pdf-generation","url-to-pdf"],"latest_commit_sha":null,"homepage":"https://ironpdf.com/tutorials/html-to-pdf/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iron-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-21T03:37:32.000Z","updated_at":"2024-01-18T18:07:19.000Z","dependencies_parsed_at":"2025-03-21T20:39:27.557Z","dependency_job_id":null,"html_url":"https://github.com/iron-software/iron-pdf-example-hello-world-csharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iron-software/iron-pdf-example-hello-world-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2Firon-pdf-example-hello-world-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2Firon-pdf-example-hello-world-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2Firon-pdf-example-hello-world-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2Firon-pdf-example-hello-world-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iron-software","download_url":"https://codeload.github.com/iron-software/iron-pdf-example-hello-world-csharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2Firon-pdf-example-hello-world-csharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276469399,"owners_count":25648097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html-to-pdf","html5","ironpdf","pdf","pdf-generation","url-to-pdf"],"created_at":"2025-03-21T20:28:47.079Z","updated_at":"2025-09-22T20:34:17.206Z","avatar_url":"https://github.com/iron-software.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IronPDF \"Hello World\" Example in C#\n\n## IronPDF Features and Compatiblity\n\nIronPDF easily handles all these features:\n- Generating PDFs from: HTML, URL, JavaScript, CSS and many image formats\n- Adding headers/footers, signatures, attachments, compression, and passwords and security\n- Performance optimization: Full Multihreading and Async support\n- And many more! Visit our website to see all our code examples and a full list of our 50+ features\n\nIronPDF also has cross platform support compatibility with:\n- .NET 7 and .NET 6, .NET Core, Standard, and Framework (4.6.2+)\n- Windows, macOS, Linux, Docker, Azure, and AWS\n\n## Code Example\n\n```csharp\nusing IronPdf;\nusing IronPdf.Engines.Chrome;\nusing IronPdf.Rendering;\n \n// Example of HTML string to be rendered into a PDF\nprivate const string SampleHtmlString = \"\u003ch1\u003eHello World!\u003c/h1\u003e\u003cbr\u003e\u003cp\u003eThis is IronPdf.\u003c/p\u003e\";\n\nstatic void Main(string[] args)\n{\n    // Get a free license key instantly: https://ironpdf.com/#trial-license\n    IronPdf.License.LicenseKey = \"ENTER-KEY-HERE\";\n    \n    Console.WriteLine(\"Welcome to the IronPDF `Hello World' Tutorial!\");\n    \n    // Example of an HTML String to PDF\n    HtmlToPdfExample(SampleHtmlString);\n    \n    // Example of URL to PDF\n    UrlToPdfExample(\"https://getbootstrap.com/\");\n    \n    Console.WriteLine(\"IronPDF Tutorial Complete! Press any key to exit!\");\n    Console.ReadKey();\n}\n\npublic static void HtmlToPdfExample(string htmlString)\n{\n    // Start by initializing the Chrome Renderer\n    ChromePdfRenderer renderer = new ChromePdfRenderer();\n\n    // Render a new PdfDocument using an HTML string\n    PdfDocument newPdf = renderer.RenderHtmlAsPdf(SampleHtmlString);\n    \n    // Save new PDF File\n    newPdf.SaveAs(\"pdf_from_html.pdf\");\n}\n\npublic static void UrlToPdfExample(string url)\n{\n    // Start by initializing the Chrome Renderer\n    ChromePdfRenderer renderer = new ChromePdfRenderer();\n\n    // Set Pdf CssMediaType to Screen to get all the background\n    renderer.RenderingOptions = new ChromePdfRenderOptions()\n    {\n        // Screen vs Print: https://ironpdf.com/how-to/pixel-perfect-html-to-pdf/#1-decide-to-use-css-media-type-print-or-screen\n        CssMediaType = PdfCssMediaType.Screen,\n        PrintHtmlBackgrounds = true,\n        \n        // Set Margins\n        MarginTop = 10,\n        MarginBottom = 10,\n        MarginLeft = 10,\n        MarginRight = 10\n    };\n    \n    // Render a new PdfDocument from a URL\n    PdfDocument newPdf = renderer.RenderUrlAsPdf(url);\n    \n    // Save new PDF File\n    newPdf.SaveAs(\"pdf_from_url.pdf\");\n}\n```\n\nGet Started creating PDF documents with IronPDF in C# now! https://github.com/iron-software\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firon-software%2Firon-pdf-example-hello-world-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firon-software%2Firon-pdf-example-hello-world-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firon-software%2Firon-pdf-example-hello-world-csharp/lists"}