{"id":3421,"date":"2026-01-26T20:10:34","date_gmt":"2026-01-26T20:10:34","guid":{"rendered":"https:\/\/xceed.com\/?p=3421"},"modified":"2026-02-02T21:34:38","modified_gmt":"2026-02-02T21:34:38","slug":"how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net","status":"publish","type":"post","link":"https:\/\/xceed.com\/es\/blog\/all\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/","title":{"rendered":"How to Create a PDF in C# with Xceed PdfLibrary for .NET"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3421\" class=\"elementor elementor-3421\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4b45c0f e-flex e-con-boxed e-con e-parent\" data-id=\"4b45c0f\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5b18421 elementor-widget elementor-widget-text-editor\" data-id=\"5b18421\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><br \/><br \/><br \/><br \/><br \/><\/p><p><style>\n    .cta-box {<br \/>\n      background: linear-gradient(145deg, #ff8441 0%, #ff772e 40%, #ff7429 100%);<br \/>\n      color: #fff;<br \/>\n      border-radius: 12px;<br \/>\n      padding: 1.5rem 1.75rem;<br \/>\n      margin: 2rem 0;<br \/>\n      box-sizing: border-box;<br \/>\n      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(168, 63, 8, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12);<br \/>\n    }<br \/>\n    .cta-box h3 {<br \/>\n      margin: 0 0 0.5rem 0;<br \/>\n      font-size: 1.25rem;<br \/>\n      font-weight: 700;<br \/>\n      color: #fff;<br \/>\n    }<br \/>\n    .cta-box p {<br \/>\n      margin: 0 0 1rem 0;<br \/>\n      font-size: 1rem;<br \/>\n      line-height: 1.5;<br \/>\n      color: #fff;<br \/>\n      opacity: 0.98;<br \/>\n    }<br \/>\n    .cta-box a.cta-link {<br \/>\n      display: inline-block;<br \/>\n      background: #fff;<br \/>\n      color: #ff671b;<br \/>\n      text-decoration: none;<br \/>\n      font-weight: 600;<br \/>\n      padding: 0.5rem 1rem;<br \/>\n      border-radius: 8px;<br \/>\n      margin-right: 0.75rem;<br \/>\n      margin-top: 0.25rem;<br \/>\n      font-size: 0.9375rem;<br \/>\n    }<br \/>\n    .cta-box a.cta-link:hover {<br \/>\n      background: #f5f5f5;<br \/>\n    }<br \/>\n    \/* Code blocks: rounded, Prism syntax highlighting *\/<br \/>\n    article pre {<br \/>\n      margin: 2rem 0;<br \/>\n      padding: 1rem 1.25rem;<br \/>\n      overflow-x: auto;<br \/>\n      font-size: 0.9rem;<br \/>\n      line-height: 1.5;<br \/>\n      border-radius: 10px;<br \/>\n      background: #1e1e1e;<br \/>\n      border: 1px solid #333;<br \/>\n    }<br \/>\n    article pre[class*=\"language-\"] {<br \/>\n      margin: 2rem 0;<br \/>\n    }<br \/>\n    article pre code {<br \/>\n      background: none;<br \/>\n      padding: 0;<br \/>\n      color: #d4d4d4;<br \/>\n    }<br \/>\n  <\/style><\/p><p>\u00a0<\/p><article><header><h1>How to Create a PDF in C# with Xceed PdfLibrary for .NET<\/h1><\/header><section><p>Generating PDFs from your .NET app is a common need: reports, invoices, or documents that users can print or share. Doing it in code gives you full control over layout, text, and structure without manual editing or external tools.<\/p><p>This guide shows how to create a PDF in C# step by step: you&#8217;ll add a simple PDF with a title and body text using <a href=\"https:\/\/xceed.com\/products\/net\/pdf-library-for-net\/#download\">Xceed PdfLibrary for .NET<\/a>. By the end you&#8217;ll have a runnable snippet, understand the core API, and know where to find samples for bookmarks, watermarks, and more.<\/p><\/section><section><h2>What you need<\/h2><ul><li>.NET 5 through .NET 10<\/li><li>The Xceed PdfLibrary for .NET assembly (trial or license). Add it via NuGet or reference the DLL from your project.<\/li><li>A couple of minutes<\/li><\/ul><\/section><section><h2>Set up the project and license<\/h2><p>Create a console or web project and add the library. From the command line (<strong>.NET CLI<\/strong>):<\/p><pre><code class=\"language-bash\">dotnet add package Xceed.PdfLibrary.NET<\/code><\/pre><p>In Visual Studio you can use the NuGet package manager or browse to <a href=\"https:\/\/www.nuget.org\/packages\/Xceed.PdfLibrary.NET\">Xceed.PdfLibrary.NET on NuGet<\/a>.<\/p><p><strong>Licensing:<\/strong> Xceed PdfLibrary requires a license key (trial or purchased) before you create or load any PDF. Get a <a href=\"https:\/\/trial.xceed.com\">free trial key<\/a> or a full license from the <a href=\"https:\/\/xceed.com\/products\/net\/pdf-library-for-net\/#download\">product page<\/a>.<\/p><p>Set the key once at application startup, before any <strong>PdfDocument<\/strong> calls:<\/p><pre><code class=\"language-csharp\">using Xceed.PdfLibrary.NET;\n\n\/\/ Set the license key once at startup (e.g. in your app's entry point)\nLicenser.LicenseKey = \"YOUR-TRIAL-OR-PURCHASED-KEY\";\n\nusing var doc = PdfDocument.Create(\"output.pdf\");\n\/\/ ... rest of your code<\/code><\/pre><\/section><section><h2>Create and save a PDF<\/h2><p>To create a PDF in C# after referencing the library, call <strong>PdfDocument.Create(path)<\/strong>. The path can be relative (e.g. <strong>&#8220;output.pdf&#8221;<\/strong>, written in your app&#8217;s current directory) or a full path. The document starts with one page; get it with <strong>doc.Pages.First()<\/strong>. From there you add a title and a line of text.<\/p><pre><code class=\"language-csharp\">using var doc = PdfDocument.Create(\"output.pdf\");\nvar page = doc.Pages.First();\nvar style = TextStyle.WithFont(doc.Fonts.GetStandardFont(StandardFontType.Helvetica), 18);\npage.AddParagraph(\"Hello from the blog\", style, new ParagraphStyle(ParagraphHorizontalAlignment.Center));\npage.AddText(\"This PDF was created with Xceed PdfLibrary for .NET.\", new Point(50, 120));\ndoc.Save();<\/code><\/pre><p>The code creates a file, adds a centered title and a line of text at position (50, 120), then saves. Coordinates are in points (72 per inch), with the origin at the top-left of the page and Y increasing downward.<\/p><p><strong>AddParagraph<\/strong> is ideal for headings and blocks that can wrap; <strong>AddText<\/strong> places a single line at a given point. Copy the snippet above into your own console or web project and run it.<\/p><\/section><section><h2>When to use AddParagraph vs AddText<\/h2><p>Use <strong>AddParagraph<\/strong> when you have a block of text (a heading or a body paragraph) that should wrap within margins or a rectangle. You can set alignment (left, center, right) via <strong>ParagraphStyle<\/strong>. For example, report titles and body paragraphs are good candidates for <strong>AddParagraph<\/strong>.<\/p><p>Use <strong>AddText<\/strong> when you need a single line at an exact position, for example labels, footers, or positioned snippets such as &#8220;Page 1 of 5&#8221;. Both methods accept a <strong>TextStyle<\/strong> for font, size, and color. Picking the right method keeps layout predictable and avoids manual line breaks.<\/p><\/section><section><h2>Add more pages and content<\/h2><p>New pages are added with <strong>doc.Pages.Add()<\/strong>. You get back the new page and add content the same way: <strong>AddParagraph<\/strong>, <strong>AddText<\/strong>, or later <strong>AddImage<\/strong>, form fields, and so on. The API is the same for every page, so building a multi-page report is a matter of looping and adding content.<\/p><p>For example, loop from 0 to N, call <strong>Add()<\/strong>, then add a heading and body text to each new page. Multi-page documents are useful for reports, invoices with itemized pages, or any content that exceeds a single sheet.<\/p><p>The same <strong>AddParagraph<\/strong> and <strong>AddText<\/strong> calls work on every page; you only need to track the vertical position (Y) if you want to flow content down the page.<\/p><p>You can set default page size and margins when creating the document or per page. Xceed PdfLibrary uses a coordinate system with the origin at the top-left; Y increases downward. That matches how many other document APIs work and is easy to reason about for headers, footers, and columns.<\/p><p>If you need a different page size (e.g. A5 or legal), configure it when creating the document or on the page before adding content.<\/p><\/section><section><h2>Styling: fonts and colors<\/h2><p>Choose the font and size via <strong>TextStyle.WithFont<\/strong> (or <strong>WithFontAndColor<\/strong> for colored text). Standard PDF fonts such as Helvetica, Helvetica-Bold, and Times are built in. For custom branding or languages you can embed TrueType fonts from a file path or stream. For centered or right-aligned paragraphs, pass a <strong>ParagraphStyle<\/strong> with the alignment you want.<\/p><p>Mixing fonts and sizes in the same document is straightforward: create a <strong>TextStyle<\/strong> per combination and pass it to <strong>AddParagraph<\/strong> or <strong>AddText<\/strong>.<\/p><p>The library works with .NET 5 through .NET 10 and runs on Windows, macOS, and Linux. The same code works in desktop apps, ASP.NET, or other host environments.<\/p><div class=\"cta-box\"><h3>Ready to build PDFs in .NET?<\/h3><p>Download Xceed PdfLibrary for .NET and try it free for 45 days, no commitment.<\/p><p><a class=\"cta-link\" href=\"https:\/\/xceed.com\/products\/net\/pdf-library-for-net\/\">Get it now &#8211; 45-day free trial<\/a><\/p><\/div><\/section><section><h2>Run the code<\/h2><p>Paste the snippets above into a console or web project, set your license key, and run. The PDF is written to the path you passed to <strong>PdfDocument.Create<\/strong> (e.g. <strong>output.pdf<\/strong>). From Visual Studio the current directory is usually the project folder; from the command line it is the folder from which you invoked the app.<\/p><p>Open the generated file in any PDF viewer to confirm the title and text appear as expected. If the file is not where you expect, use an absolute path (e.g. <strong>Path.Combine(AppContext.BaseDirectory, &#8220;output.pdf&#8221;)<\/strong>) or check your working directory in the debugger.<\/p><\/section><section><h2>Common questions<\/h2><p><strong>Do I need to dispose the document?<\/strong> Yes. Use <strong>using<\/strong> (as in the snippet) or call <strong>Dispose<\/strong> so file handles and streams are released.<\/p><p><strong>Can I save to a stream instead of a file?<\/strong> Yes. Use the overloads that accept a <strong>Stream<\/strong> for creation or <strong>SaveAs(stream)<\/strong> when saving. That is useful when generating PDFs in memory for web responses or APIs.<\/p><p><strong>Can I create a PDF in memory without a file?<\/strong> Yes. Create the document with a <strong>Stream<\/strong> (e.g. <strong>MemoryStream<\/strong>) and call <strong>Save<\/strong> or <strong>SaveAs<\/strong> to write to that stream. You can then use the buffer for uploads or responses.<\/p><p><strong>What if I get a license or file error?<\/strong> Set <strong>Licenser.LicenseKey<\/strong> before any <strong>PdfDocument<\/strong> call. If the PDF is not found after running, check that the path is relative to your process current directory or use an absolute path.<\/p><p><strong>Where can I see more samples?<\/strong> See the <a href=\"https:\/\/xceed.com\/documentation\/xceed-pdf-for-net\/\">Xceed PdfLibrary for .NET documentation<\/a> for advanced topics and more examples.<\/p><p><strong>Can I use this in an ASP.NET Core app?<\/strong> Yes. The same code runs in any .NET host. Set the license key at startup (e.g. in <strong>Program.cs<\/strong> or when building the host), then create or load PDFs in your controllers or services. For web responses, create the document with a <strong>MemoryStream<\/strong> and return it with the appropriate <strong>Content-Type: application\/pdf<\/strong> header.<\/p><p><strong>Summary:<\/strong> You&#8217;ve seen how to create a PDF in C#: install the package, set the license key once at startup, then use <strong>PdfDocument.Create<\/strong>, <strong>Pages<\/strong>, <strong>AddParagraph<\/strong>, and <strong>AddText<\/strong> to build your first PDF.<\/p><\/section><section><h2>What else can you do with Xceed PdfLibrary?<\/h2><p>With Xceed PdfLibrary for .NET you can add bookmarks, hyperlinks, images, and form fields (text boxes, checkboxes, signature fields). You can load an existing PDF, modify it, and save to a new file, or extract text and metadata. The same patterns you used here (create or load, get pages, add content, save) apply across these features.<\/p><p>Once you&#8217;re comfortable with how to create a PDF in C#, try adding images or form fields using the same document and page API.<\/p><\/section><section><h2>Next steps<\/h2><ul><li><a href=\"https:\/\/xceed.com\/products\/net\/pdf-library-for-net\/#download\">Download Xceed PdfLibrary for .NET<\/a> or <a href=\"https:\/\/trial.xceed.com\">get a free trial key<\/a><\/li><li>Install via NuGet: <a href=\"https:\/\/www.nuget.org\/packages\/Xceed.PdfLibrary.NET\">Xceed.PdfLibrary.NET<\/a> &#8211; .NET CLI:<\/li><li><a href=\"https:\/\/xceed.com\/blog\/all\/how-to-extract-content-from-a-pdf-in-c-with-xceed-pdflibrary-for-net\/\">Learn how to extract content from a PDF in C#!<\/a><\/li><\/ul><pre><code class=\"language-bash\">dotnet add package Xceed.PdfLibrary.NET<\/code><\/pre><\/section><\/article><p><script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.29.0\/prism.min.js\"><\/script><br \/><script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.29.0\/components\/prism-csharp.min.js\"><\/script><br \/><script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.29.0\/components\/prism-bash.min.js\"><\/script><br \/><script>Prism.highlightAll();<\/script><br \/><br \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Create a simple PDF with a title and body text in C# using Xceed PdfLibrary for .NET. Set up the project, add the license, then use PdfDocument.Create, AddParagraph, and AddText to build your first PDF.<\/p>","protected":false},"author":3,"featured_media":3431,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[141,60,1],"tags":[451,701,703,619,702],"class_list":["post-3421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-all","category-tutorials","category-uncategorized","tag-c","tag-create-pdf","tag-dotnet-pdf","tag-pdf","tag-pdf-creation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a PDF in C# with Xceed PdfLibrary for .NET - Xceed<\/title>\n<meta name=\"description\" content=\"Learn how to create a PDF in C# step by step. Add text, set fonts, and save from .NET with Xceed PdfLibrary. Try the sample code!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/xceed.com\/es\/blog\/sin-categoria\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a PDF in C# with Xceed PdfLibrary for .NET - Xceed\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a PDF in C# step by step. Add text, set fonts, and save from .NET with Xceed PdfLibrary. Try the sample code!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/xceed.com\/es\/blog\/sin-categoria\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/\" \/>\n<meta property=\"og:site_name\" content=\"Xceed\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-26T20:10:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-02T21:34:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/xceed.com\/wp-content\/uploads\/2026\/01\/csharppdf-3-1024x683.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"683\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mathieu Drimonakos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mathieu Drimonakos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/\"},\"author\":{\"name\":\"Mathieu Drimonakos\",\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#\\\/schema\\\/person\\\/755c0d7faf7423a1e441aa6b79ca8205\"},\"headline\":\"How to Create a PDF in C# with Xceed PdfLibrary for .NET\",\"datePublished\":\"2026-01-26T20:10:34+00:00\",\"dateModified\":\"2026-02-02T21:34:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/\"},\"wordCount\":1270,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/xceed.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/csharppdf-3.png\",\"keywords\":[\"C#\",\"create pdf\",\"dotnet pdf\",\"pdf\",\"pdf creation\"],\"articleSection\":[\"All\",\"Tutorials\",\"Uncategorized\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/\",\"url\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/\",\"name\":\"How to Create a PDF in C# with Xceed PdfLibrary for .NET - Xceed\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/xceed.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/csharppdf-3.png\",\"datePublished\":\"2026-01-26T20:10:34+00:00\",\"dateModified\":\"2026-02-02T21:34:38+00:00\",\"description\":\"Learn how to create a PDF in C# step by step. Add text, set fonts, and save from .NET with Xceed PdfLibrary. Try the sample code!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#primaryimage\",\"url\":\"https:\\\/\\\/xceed.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/csharppdf-3.png\",\"contentUrl\":\"https:\\\/\\\/xceed.com\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/csharppdf-3.png\",\"width\":1536,\"height\":1024,\"caption\":\"create pdf files using c#\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/xceed.com\\\/blog\\\/uncategorized\\\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/xceed.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a PDF in C# with Xceed PdfLibrary for .NET\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/xceed.com\\\/fr\\\/\",\"name\":\"Xceed\",\"description\":\"Provides tools for .NET, Windows Forms, WPF, Silverlight, and ASP.NET developers to create better applications.\",\"publisher\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/xceed.com\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#organization\",\"name\":\"Xceed\",\"url\":\"https:\\\/\\\/xceed.com\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/xceed.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/cropped-xceed-logo.png\",\"contentUrl\":\"https:\\\/\\\/xceed.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/cropped-xceed-logo.png\",\"width\":609,\"height\":150,\"caption\":\"Xceed\"},\"image\":{\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/xceed.com\\\/fr\\\/#\\\/schema\\\/person\\\/755c0d7faf7423a1e441aa6b79ca8205\",\"name\":\"Mathieu Drimonakos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f98fd5ceb0a01e45d9caabde3e75b68779a73f7754af7b814cd2e1008dd870aa?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f98fd5ceb0a01e45d9caabde3e75b68779a73f7754af7b814cd2e1008dd870aa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f98fd5ceb0a01e45d9caabde3e75b68779a73f7754af7b814cd2e1008dd870aa?s=96&d=mm&r=g\",\"caption\":\"Mathieu Drimonakos\"},\"url\":\"https:\\\/\\\/xceed.com\\\/es\\\/blog\\\/author\\\/drimonakosmxceed-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a PDF in C# with Xceed PdfLibrary for .NET - Xceed","description":"Learn how to create a PDF in C# step by step. Add text, set fonts, and save from .NET with Xceed PdfLibrary. Try the sample code!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/xceed.com\/es\/blog\/sin-categoria\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/","og_locale":"es_MX","og_type":"article","og_title":"How to Create a PDF in C# with Xceed PdfLibrary for .NET - Xceed","og_description":"Learn how to create a PDF in C# step by step. Add text, set fonts, and save from .NET with Xceed PdfLibrary. Try the sample code!","og_url":"https:\/\/xceed.com\/es\/blog\/sin-categoria\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/","og_site_name":"Xceed","article_published_time":"2026-01-26T20:10:34+00:00","article_modified_time":"2026-02-02T21:34:38+00:00","og_image":[{"width":1024,"height":683,"url":"https:\/\/xceed.com\/wp-content\/uploads\/2026\/01\/csharppdf-3-1024x683.png","type":"image\/png"}],"author":"Mathieu Drimonakos","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mathieu Drimonakos","Est. reading time":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#article","isPartOf":{"@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/"},"author":{"name":"Mathieu Drimonakos","@id":"https:\/\/xceed.com\/fr\/#\/schema\/person\/755c0d7faf7423a1e441aa6b79ca8205"},"headline":"How to Create a PDF in C# with Xceed PdfLibrary for .NET","datePublished":"2026-01-26T20:10:34+00:00","dateModified":"2026-02-02T21:34:38+00:00","mainEntityOfPage":{"@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/"},"wordCount":1270,"commentCount":0,"publisher":{"@id":"https:\/\/xceed.com\/fr\/#organization"},"image":{"@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#primaryimage"},"thumbnailUrl":"https:\/\/xceed.com\/wp-content\/uploads\/2026\/01\/csharppdf-3.png","keywords":["C#","create pdf","dotnet pdf","pdf","pdf creation"],"articleSection":["All","Tutorials","Uncategorized"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/","url":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/","name":"How to Create a PDF in C# with Xceed PdfLibrary for .NET - Xceed","isPartOf":{"@id":"https:\/\/xceed.com\/fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#primaryimage"},"image":{"@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#primaryimage"},"thumbnailUrl":"https:\/\/xceed.com\/wp-content\/uploads\/2026\/01\/csharppdf-3.png","datePublished":"2026-01-26T20:10:34+00:00","dateModified":"2026-02-02T21:34:38+00:00","description":"Learn how to create a PDF in C# step by step. Add text, set fonts, and save from .NET with Xceed PdfLibrary. Try the sample code!","breadcrumb":{"@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#primaryimage","url":"https:\/\/xceed.com\/wp-content\/uploads\/2026\/01\/csharppdf-3.png","contentUrl":"https:\/\/xceed.com\/wp-content\/uploads\/2026\/01\/csharppdf-3.png","width":1536,"height":1024,"caption":"create pdf files using c#"},{"@type":"BreadcrumbList","@id":"https:\/\/xceed.com\/blog\/uncategorized\/how-to-create-a-pdf-in-c-with-xceed-pdflibrary-for-net\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/xceed.com\/"},{"@type":"ListItem","position":2,"name":"How to Create a PDF in C# with Xceed PdfLibrary for .NET"}]},{"@type":"WebSite","@id":"https:\/\/xceed.com\/fr\/#website","url":"https:\/\/xceed.com\/fr\/","name":"Xceed","description":"Proporciona herramientas para que los desarrolladores de .NET, Windows Forms, WPF, Silverlight y ASP.NET puedan crear mejores aplicaciones.","publisher":{"@id":"https:\/\/xceed.com\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/xceed.com\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/xceed.com\/fr\/#organization","name":"Xceed","url":"https:\/\/xceed.com\/fr\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/xceed.com\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/xceed.com\/wp-content\/uploads\/2024\/04\/cropped-xceed-logo.png","contentUrl":"https:\/\/xceed.com\/wp-content\/uploads\/2024\/04\/cropped-xceed-logo.png","width":609,"height":150,"caption":"Xceed"},"image":{"@id":"https:\/\/xceed.com\/fr\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/xceed.com\/fr\/#\/schema\/person\/755c0d7faf7423a1e441aa6b79ca8205","name":"Mathieu Drimonakos","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/f98fd5ceb0a01e45d9caabde3e75b68779a73f7754af7b814cd2e1008dd870aa?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f98fd5ceb0a01e45d9caabde3e75b68779a73f7754af7b814cd2e1008dd870aa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f98fd5ceb0a01e45d9caabde3e75b68779a73f7754af7b814cd2e1008dd870aa?s=96&d=mm&r=g","caption":"Mathieu Drimonakos"},"url":"https:\/\/xceed.com\/es\/blog\/author\/drimonakosmxceed-com\/"}]}},"_links":{"self":[{"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/posts\/3421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/comments?post=3421"}],"version-history":[{"count":0,"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/posts\/3421\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/media\/3431"}],"wp:attachment":[{"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/media?parent=3421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/categories?post=3421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xceed.com\/es\/wp-json\/wp\/v2\/tags?post=3421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}