Telerik Forums
Telerik Document Processing Forum
1 answer
1.5K+ views

After upgrading the Telerik Document Processing libraries to version Q1 2025 the following error messages may occur:

* "The file or assembly cannot be loaded 'Telerik.Licensing.Runtime, Version=1.4.6.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the specified file."

* "NU1101: Unable to find package Telerik.Licensing. No packages exist with this id in source(s): Telerik nuget. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org."

Dess | Tech Support Engineer, Principal
Telerik team
 updated answer on 12 Nov 2025
1 answer
120 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
180 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
87 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
100 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
141 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
83 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
2 answers
138 views

Hello,

I just upgraded telerik, and i have troubles referencing  Workbook / Worksheet / etc...

Is the documentation up to date ?

In the documentation, namespace for Workbook is still Telerik.Windows.Documents.Spreadsheet.Model. But it doesnt exist anymore : 

 

I am using 11.1.0 :

 

 

 

 

Sébastien
Top achievements
Rank 1
Iron
 answered on 21 Aug 2025
4 answers
147 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
1 answer
424 views
I'm using SpreadProcessing in conjunction with a Blazor TelerikSpreadsheet component and when there are two worksheets and the second sheet is active, Workbook.ActiveWorksheet is incorrectly reporting that the first sheet is active. See the attached repro project.
Yoan
Telerik team
 answered on 21 Jul 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?