Telerik Forums
Telerik Document Processing Forum
1 answer
8 views

Good Afternoon, 

I am trying to create a PDF with an empty signature field. It was working a few months ago, when the site was first built, but now when a user opens the PDF in Acrobat to sign the document, they get an error saying the document could not be read (23).

I have stripped away all the code so it's now only generating an empty signature field. It's still refusing to work properly in Adobe Acrobat.  When attempting to sign, there is a message about constructs that could affect appearance with a 4000 code for Unrecognized PDF Content. When I proceed, I get the error messages attached.

Any advice would be greatly appreciated, I have been struggling with this for hours!

I am using Telerik Version 2025.3.806. I have updated Adobe Acrobat to the latest version and restarted my computer several times. 

This code is taken directly from the Telerik docs, so I expected it to work. I've included the produced PDF, as well.

public void PdfExportSignatureTest()
{
    // Create a new PDF document and a page
    RadFixedDocument document = new RadFixedDocument();
    RadFixedPage page = document.Pages.AddPage();

    // Define the rectangle for the signature field
    Rect signatureRect = new Rect(50, 700, 200, 50);

    // Create the signature field (do not assign a certificate or signature)
    SignatureField signatureField = document.AcroForm.FormFields.AddSignature("SignatureFieldUniqueName");

    // Add a widget for the signature field and set its position and size
    SignatureWidget signatureWidget = signatureField.Widgets.AddWidget();
    signatureWidget.Rect = signatureRect;

    // Add the widget to the page's annotations
    page.Annotations.Add(signatureWidget);

    PdfFormatProvider provider = new();

    // Save the document
    string filePath = "EmptySignatureWidget.pdf";
    File.Delete(filePath);
    using (var output = new System.IO.FileStream(filePath, System.IO.FileMode.Create, System.IO.FileAccess.Write))
    {
        provider.Export(document, output, TimeSpan.FromSeconds(10));
    }
}

 

 

Yoan
Telerik team
 answered on 04 Feb 2026
1 answer
30 views

Hi

I import a docx document with a strikerhough text in it.

When I then convert it to PDF using PdfFormatProvider export. the strikethrough effect does not appeared, in the the text is shown.

 

                            var docxProvider = new DocxFormatProvider();
                            outputStream.Position = 0;
                            var flowDocument = docxProvider.Import(outputStream);

                            var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
                            var pdfStream = new MemoryStream();
                            pdfProvider.Export(flowDocument, pdfStream);
Yoan
Telerik team
 answered on 12 Dec 2025
1 answer
38 views

I have a DOCX that undergoes a merge leaving me with 3 text fields after merge. All 3 fields are Times New Roman 12. I'm not using any custom font provider.

After export to PDF, 2 of the fields remain intact but one of them is always blank. 

I've attached screenshots showing the 3 fields plus the DOCX and PDF.

Can you tell me what the issue is? There are no special characters around the text and it's using the same font as the other fields? Printing it to PDF from Word locally works fine, giving me the 3 fields.

Here's the code that the export happens in -


        private async Task<Tuple<int, bool>> MakePDFFromWordDocxBytes(string pdfFilePath, byte[] bytes, string traceInfo, bool isSecondaryMergeNeeded)
        {
            int result = 0;
            byte[] pdfBytes = null;
            bool isError = false;
            try
            {
                RadFlowDocument document = ReplaceSignatureFieldsAndEmptyTables(bytes);

                // Create a new list with the data to avoid enumeration issues
                RadFlowDocument merged = PartialMailMerge(document, isSecondaryMergeNeeded); //   document.MailMerge(dataSource);

                if (isSecondaryMergeNeeded)
                {
                    DocxFormatProvider docProvider = new DocxFormatProvider();
                    string docxFileName = pdfFilePath.Replace(".pdf", ".docx");
                    using (IFileManager fileMan = FileCommon.GetFileInstance(docxFileName))
                    {
                        var docxBytes = docProvider.Export(merged, TimeSpan.FromSeconds(docLoadTimeoutSeconds));
                        fileMan.SaveFile(docxFileName, docxBytes);
                    }
                }
                TelPDFFlow.PdfFormatProvider pdfProvider = new TelPDFFlow.PdfFormatProvider();
                pdfProvider.ExportSettings = new TelPDFFlow.Export.PdfExportSettings()
                {
                    ComplianceLevel = TelPDFFixed.Export.PdfComplianceLevel.PdfA1B,
                    FontEmbeddingType = TelPDFFixed.Export.FontEmbeddingType.Full
                };
                pdfBytes = pdfProvider.Export(merged, TimeSpan.FromSeconds(docLoadTimeoutSeconds));
            }
            catch (Exception ex)
            {
                EventLogger.WriteError(traceInfo, ex);
                pdfBytes = ExceptionPDFAsBytes(ex, $"ERROR {traceInfo}");
                isError = true;
            }

            using (IFileManager fileManager = FileCommon.GetFileInstance(pdfFilePath))
            {
                fileManager.SaveFile(pdfFilePath, pdfBytes);
            }
            result = GetPDFPageCountFromPDFBytes(pdfBytes);
            return new Tuple<int, bool>(result, isError);
        }

Yoan
Telerik team
 answered on 17 Nov 2025
1 answer
40 views

Hello,

I want to ask how can make the exported PDF from RTF follows spacing on RTF.
I have RTF file (as attached) , when i try tp export to pdf some paragraph not looking exactly like the RTF , i suspect it because using Justified setting.
Is it a bug ? or can we export the RTF to PDF that have exacts look after exporting to PDF ?

i use Telerik.Documents.Core, Fixed, Flow, Flow.FormattedProvider.Pdf , File Version : 2025.2.520.20 
The project is a .NET 8 class library

Please see attached file (RTF source and exported PDF).

private bool ConvertRtfToPdfWithTelerik(string rtfPath, string pdfPath)
{
    try
    {
        Console.WriteLine("Converting RTF to PDF using Telerik Document Processing...");

        // Create RTF format provider
        RtfFormatProvider rtfProvider = new RtfFormatProvider();

        Telerik.Windows.Documents.Extensibility.FontsProviderBase fontsProvider = new FontsProvider();
        Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.FontsProvider = fontsProvider;
        
        // Load RTF document
        RadFlowDocument document;
        //Size oSize = new Size();
        //Padding oPadding = null;

        using (FileStream rtfStream = new FileStream(rtfPath, FileMode.Open))
        {
            document = rtfProvider.Import(rtfStream, null);
            //oSize = document.Sections[0].PageSize;
            //oPadding = document.Sections[0].PageMargins;
        }

        //foreach (var item in document.Sections)
        //{
        //    //item.PageMargins = new Padding(90);
        //    item.PageSize = PaperTypeConverter.ToSize(PaperTypes.Letter);
        //}

        Console.WriteLine("RTF document loaded successfully with Telerik");

        // Create PDF format provider
        PdfFormatProvider pdfProvider = new PdfFormatProvider();

        // Export to PDF
        using (FileStream pdfStream = new FileStream(pdfPath, FileMode.Create))
        {
            pdfProvider.ExportSettings.FontEmbeddingType = Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.FontEmbeddingType.Full;
            pdfProvider.ExportSettings.ImageQuality = Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.ImageQuality.High;
            pdfProvider.Export(document, pdfStream, null);
        }

        Console.WriteLine("PDF generated successfully using Telerik Document Processing");
        return true;
    }
    catch (Exception ex)
    {
        Console.WriteLine("Error converting RTF to PDF with Telerik: " + ex.Message);
        return false;
    }
}

public class FontsProvider : Telerik.Windows.Documents.Extensibility.FontsProviderBase
{
    public override byte[] GetFontData(Telerik.Windows.Documents.Core.Fonts.FontProperties fontProperties)
    {
        string fontFileName = fontProperties.FontFamilyName + ".ttf";
        string fontFolder = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);

        //The fonts can differ depending on the file 
        if (fontProperties.FontFamilyName == "Calibri")
        {
            if (fontProperties.FontStyle == FontStyles.Italic && fontProperties.FontWeight == FontWeights.Bold)
            {
                fontFileName = $"calibriz.ttf";
            }
            else if (fontProperties.FontStyle == FontStyles.Italic)
            {
                fontFileName = $"calibrii.ttf";
            }
            else if (fontProperties.FontWeight == FontWeights.Normal)
            {
                fontFileName = "calibri.ttf";
            }
            else if (fontProperties.FontWeight == FontWeights.Bold)
            {
                fontFileName = $"calibrib.ttf";
            }
        }

        else if (fontProperties.FontFamilyName == "Century Gothic")
        {
            if (fontProperties.FontStyle == FontStyles.Italic && fontProperties.FontWeight == FontWeights.Bold)
            {
                fontFileName = $"gothicbi.ttf";
            }
            else if (fontProperties.FontStyle == FontStyles.Italic)
            {
                fontFileName = $"gothici.ttf";
            }
            else if (fontProperties.FontWeight == FontWeights.Normal)
            {
                fontFileName = "gothic.ttf";
            }
            else if (fontProperties.FontWeight == FontWeights.Bold)
            {
                fontFileName = $"gothicb.ttf";
            }
        }

        else if (fontProperties.FontFamilyName == "Wingdings")
        {
            if (fontProperties.FontWeight == FontWeights.Normal)
            {
                fontFileName = $"wingding.ttf";
            }
        }

        //...add more fonts if needed... 

        DirectoryInfo directory = new DirectoryInfo(fontFolder);
        FileInfo[] fontFiles = directory.GetFiles();

        var fontFile = fontFiles.FirstOrDefault(f => f.Name.Equals(fontFileName, StringComparison.InvariantCultureIgnoreCase));
        if (fontFile != null)
        {
            var targetPath = fontFile.FullName;
            using (FileStream fileStream = File.OpenRead(targetPath))
            {
                using (MemoryStream memoryStream = new MemoryStream())
                {
                    fileStream.CopyTo(memoryStream);
                    return memoryStream.ToArray();
                }
            }
        }

        return null;
    }
}


Yoan
Telerik team
 answered on 11 Nov 2025
1 answer
62 views

Hi,

We are trying to merge an existing PDF (not /A) into a PDF/A.

Target file is generated successfully but veraPDF validator (and others) is complaining because it cannot find embedded fonts.

We read the following articles : PDF/A standard and Register fonts . But no luck.

Part of the code is available below.

Do you know why fonts are not embedded ?

Thanks for your help.

Alain.

 

public static void MergeInNewFile(string sourceFile, string outputFilePath, bool registerFonts)
{
    RadFixedDocument resultFile = new RadFixedDocument();

    Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider pdfFormatProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();

    pdfFormatProvider.ExportSettings.FontEmbeddingType = FontEmbeddingType.Full;

    PdfExportSettings settings = new PdfExportSettings();
    pdfFormatProvider.ExportSettings = settings;

    settings.ComplianceLevel = PdfComplianceLevel.PdfA3B;
    settings.TaggingStrategy = TaggingStrategyType.UseExisting;
    settings.FontEmbeddingType = FontEmbeddingType.Full;

    if (registerFonts)
    {
        RegisterFont("Helvetica");
        RegisterFont("Helvetica-Bold");
        RegisterFont("Helvetica-Oblique");
    }

    // Merge source in new file
    using (Stream stream = File.OpenRead(sourceFile))
    {
        resultFile = pdfFormatProvider.Import(stream, TimeSpan.FromSeconds(100));
        resultFile.Merge(resultFile);
    }

    // Export new file
    File.Delete(outputFilePath);
    using (Stream output = File.OpenWrite(outputFilePath))
    {
        pdfFormatProvider.Export(resultFile, output, TimeSpan.FromSeconds(10));
    }
}

private static void RegisterFont(string fontName)
{
    byte[] fontData = File.ReadAllBytes(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ressources", $"{fontName}.ttf"));
    System.Windows.Media.FontFamily fontFamily = new System.Windows.Media.FontFamily(fontName);
    FontsRepository.RegisterFont(fontFamily, System.Windows.FontStyles.Normal, System.Windows.FontWeights.Bold, fontData);
}


 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Nov 2025
1 answer
27 views
Issue Summary:

When previewing PDF documents using RadPdfView (Telerik UI for WPF), the logo positioned at the top-left corner of the page fails to render consistently across machines. While the rest of the document displays correctly, the logo either appears distorted or is missing entirely.

Environment:

  • Control Used: RadPdfView (Telerik UI for WPF)
  • Telerik Libraries:
    • Telerik.Windows.Documents.dll – Version 2023.1.315.45
    • Telerik.Windows.Documents.Core.dll – Version 2023.1.307.40
  • Operating Systems Tested:
    • Windows 10 Pro: Logo appears stretched and centered
    • Windows 11 Pro (Version 25H2, OS Build 26200.6899): Logo is missing

Symptoms:

  • The logo, embedded in the PDF and originally positioned at the top-left corner, does not render correctly in RadPdfView.
  • The issue is isolated to RadPdfView; the same PDF displays the logo correctly in WebView2 and standard web browsers.

Troubleshooting Steps Taken:

  • Verified that the logo is present when viewed in other PDF viewers.
  • Tested across multiple machines using identical code and PDF files.

Temporary Workaround:
Using <wv2:WebView2> to preview the PDF resolves the issue, indicating that the problem is specific to RadPdfView’s rendering engine.

Request:
Please confirm whether this is a known issue with the specified Telerik versions and advise if a fix or recommended workaround is available to ensure consistent logo rendering in RadPdfView across platforms.

Note: Using .NET version 4.8

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 Nov 2025
1 answer
41 views


RadFlowDocument document = provider.Import(htmlContent, new TimeSpan(0, 0, 0, 30));


I have a PDF that's supposed to use bootstrap styles, and I'm having trouble applying them.  I have three divs that need to be in-line but they keep end up on their own line instead.  They are an image, then a title, then another image.  All need to be on one line.  But bootstrap, flex, whatever I throw at it, they keep going on their own lines instead, like block elements.

I want:  image/title/image

I get:

image
title
image

Here's the cshtml:


@using Kendo.Mvc.Extensions


<link href="~/Content/css/sprite.css" rel="stylesheet" />
<link href="~/Content/css/build/report.css" rel="stylesheet" />

<style>
    .row {
        --bs-gutter-x: 1.5rem;
        --bs-gutter-y: 0;
        display: flex !important;
        flex-wrap: wrap;
        margin-top: calc(-1 * var(--bs-gutter-y));
        margin-right: calc(-0.5 * var(--bs-gutter-x));
        margin-left: calc(-0.5 * var(--bs-gutter-x));
    }

    .row > * {
        flex-shrink: 0;
        width: 100%;
        max-width: 100%;
        padding-right: calc(var(--bs-gutter-x) * 0.5);
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        margin-top: var(--bs-gutter-y);
    }
    .tbox {
        display: table;
        width: 100%;
        height: 100%;
        border-spacing: 0;
        table-layout: fixed;
        outline: 5px solid red;
    }

    .tcol
    {
        display: table-cell;
        float: none;
        height: 100%;
        vertical-align: top;

    }

    .col-md-10 {
        flex: 0 0 auto;
        width: 83.33333333%;
    }
</style>


<div class="row">
    <div class="col-md-offset-1 col-md-10 col">
        <div class="tbox" style="height: auto; display: flex !important">
            <div class="tcol" style="width: 25%">
                <img class="logo" src="URI" alt="official seal" />
            </div>
            <div class="tcol text-center" style="width: 25%">
                <h1 class="m-15">
                    TITLE OF PDF
                </h1>
                <h2> @Model.ProjectNumber Project Plan </h2>
                <h4 class="datestamp">@DateTime.UtcNow.UtcToApplicationTimeZone().ToString("MM/dd/yyyy")</h4>
            </div>
            @if (Model.ProgramId == (Int32)EnumRefProgram.ABCDEF)
            {
                <div class="tcol text-right" style="width: 25%">
                    <img class="logo" src="URI" alt="official seal" />
                </div>
            }
            else
            {
                <div class="tcol text-right" style="width: 25%">
                    <img class="logo" src="URI" alt="official seal" />
                </div>
            }
        </div>
    </div>
</div>

This isn't the whole document, just the relevant part I'm struggling with.  Linking bootstrap directly didn't work (and seemed like a bad idea anyways due to its size) so I just started copying in the relevant classes into the style tag.  The .row class alone should be sufficient to make the three divs (the two images and the title) all inline in one line, but it seems to have no effect in the PDF.  I also tried making one of the divs a flex container by giving it display:flex and again, no effect.  If I grab the HTML string from the debugger, the moment before it is fed into this: RadFlowDocument document = provider.Import(htmlContent, new TimeSpan(0, 0, 0, 30)); and I take that html and save it as an html document and open it in my browser, the classes work appropriately, the image/title/image display inline as desired.  So I know the mark up and the CSS are functional, but I don't get why it doesn't work with the conversion to PDF.

I'm also aware that putting flex in one of the divs inside a .row div is redundant but I was trying to figure out what wasn't working.

Yoan
Telerik team
 answered on 23 Oct 2025
1 answer
60 views

Hello,

I'm trying to rewrite a PDF-generator function that creates a PDF from HTML (which is the result of an XSLT+xml transform) using another HTML to PDF library to a new function that uses the Telerik methods. That works Ok, but there are 2 things I can't figure out how to do (if even possible) :

- The HTML content consists of a table with uneven row heights, depending on the content. Some rows contain images, some don't. So, I can't determine beforehand which row needs to start on a new page. Currently, I use page-break-inside: avoid on the rows, and that works with the other library, but not with the Telerik methods. Some rows are split over two pages. How can I prevent an element from breaking up over two pages?

- With the current library, I'm able to provide a separate PDF file that is used as a background for every rendered page. That PDF is a single-page PDF with the 'corporate stationery' (don't know how that's called ;-), so the resulting PDF contains multiple pages with the HTML output in the company style. Is something like that possible with the Telerik methods?  I know how to draw a small HTML snippet on a single PDF page, but I can't figure out how to convert HTML to PDF with this background on every page.

Any help is appreciated.

Regards,
Kees

Yoan
Telerik team
 answered on 13 Oct 2025
1 answer
36 views

I am looking at this example.  Is it possible to format the text using HTML tags?

For ex: can the textboxvalue = <b>text</b>?
void ProcessTextBox(TextBoxField textBoxField, string textboxValue)
    {
        textBoxField.Value = textboxValue;
    }

https://demos.telerik.com/blazor-ui/pdfprocessing/read-and-write-form-fields

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Sep 2025
4 answers
75 views

I've obtained a x509 signing certificate and able to use it with Telerik PDF processing to generate a signed PDF. The problem is that none of the signatures are valid because of the time stamp!

There doesn't appear to be any way to insert a TSA timestamp with the signing flow.

How can I fix this, the Telerik signatures are useless otherwise.


Thanks!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Jul 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?