Declined
Last Updated: 23 Sep 2021 08:46 by ADMIN
Created by: Linus
Comments: 2
Category: PdfProcessing
Type: Bug Report
0

Hi, 

 

I am trying to convert a HTML body to a PDF using HtmlFormatProvider and PdfFormatProvider. 

It works well when I try to create a pdf with "normal" characters, but when I use characters like "åäö" the characters is either missing or replaced with other character. 

I have found a similiar issue but that was due to the fact that the person was using .net core I am using .net framework. 

Am I missing something when I am converting it to a PDF or is there a limitation with special characters like "åäö". 

 


        private string CreateAndStorePdf(string htmlBody)
        {
            Telerik.Windows.Documents.Extensibility.JpegImageConverterBase jpegImageConverter = new Telerik.Documents.ImageUtils.JpegImageConverter();
            Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = jpegImageConverter;

            var provider = new HtmlFormatProvider();
            var document = provider.Import(htmlBody);
            var exportProvider = new PdfFormatProvider();
            var fixedExportProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
            var fileName = "_original.pdf";

            try
            {
                using (var outputStream = new MemoryStream())
                {
                    exportProvider.Export(fixedExportProvider.ExportToFixedDocument(document), outputStream);
                    outputStream.Seek(0, SeekOrigin.Begin);
                    var pdfBytes = new BinaryReader(outputStream).ReadBytes((int)outputStream.Length);

                    return fileName;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "The pdf could not be created.");
                return null;
            }
        }

 

 

Completed
Last Updated: 04 Oct 2021 13:59 by Matthew
Release LIB 2021.3.1011 (11 Oct 2021)
When importing a document containing Widget annotations with an appearance set that contains Marked content (BMC-EMC) with no Field Type (FT) operands set an exception is thrown: System.NullReferenceException: 'Object reference not set to an instance of an object.'
Unplanned
Last Updated: 12 Oct 2021 12:02 by ADMIN

Some Shading elements are not property imported which leads to unexpected drawings on the exported (previewed in the PdfViewer) document.

Unplanned
Last Updated: 14 Oct 2021 08:50 by ADMIN
Created by: Avrohom Yisroel
Comments: 0
Category: PdfProcessing
Type: Feature Request
0

Currently, when registering *.pfb font file with FontsRepository.RegisterFont method an exception is thrown during the font creation. 

WORKAROUND:  The font file may be converted to TTF format (*.ttf) which is successfully registered.

Unplanned
Last Updated: 18 Oct 2021 08:14 by ADMIN
When creating several documents in a parallel loop (Parallel.ForEach) using the PdfStreamWriter and inserting Block content in them, there are missing characters in some files.

Completed
Last Updated: 30 Nov 2021 09:32 by ADMIN
Release R1 2022

When invoking the FontsRepository.TryCreateFont() method to create Font from an installed TrueType font with font properties set (FontStyles.Italic, FontWeights.Bold) the name of the created font is not correct.

FontBase font;
bool isRegistered = FontsRepository.TryCreateFont(new FontFamily("Helvetica"), FontStyles.Italic, FontWeights.Bold, out font);

Expected:<Helvetica-BoldOblique>
Actual:<Helvetica,Italic>

Unplanned
Last Updated: 15 Nov 2021 07:01 by ADMIN

A small line is drawn in the top left corner when converting a paragraph with a shading color to a PDF

Workaround: 

var table = header.Blocks.AddTable();
table.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 100);
var row = table.Rows.AddTableRow();
var cell = row.Cells.AddTableCell();
cell.Shading.BackgroundColor = new ThemableColor(Colors.Red);

var head = new Run(doc);
head.Text = "Test";
var paragraph = cell.Blocks.AddParagraph();
paragraph.TextAlignment = Telerik.Windows.Documents.Flow.Model.Styles.Alignment.Center;
paragraph.Inlines.Add(head);

Completed
Last Updated: 23 Nov 2021 12:50 by ADMIN
Release R1 2022
When merging documents with the RadFixedDocument`s Merge() method the Image`s StencilColor property value is not preserved which leads to different color results.
Completed
Last Updated: 23 Nov 2021 11:42 by ADMIN
Release R1 2022

When Bold and Italic properties are set in the TrueType font file`s OS/2 table they are not respected and the OpenTypeFontSource`s Bold and Italic properties are not correct.

Completed
Last Updated: 20 Jan 2022 08:15 by ADMIN
Release R1 2022
Created by: Rick
Comments: 0
Category: PdfProcessing
Type: Feature Request
0
Expose a way to get the actual font name. Currently, only the subset name is available.
Completed
Last Updated: 08 Feb 2022 14:06 by ADMIN
Release R1 2022 SP1

When the Font`s Widths array contains entries defined as Indirect references an exception is thrown: System.ArgumentException: 'The IndirectReference type cannot be converted to a real numeric value.'

According to the Pdf Specification: The glyph widths are measured in units in which 1000 units corresponds to 1 unit in text space.

Unplanned
Last Updated: 06 Dec 2021 09:42 by ADMIN

When importing a document containing text fragment with a wrong Type3 font set the glyph cannot be obtained from the font and an exception is thrown: System.InvalidOperationException: 'Cannot create glyph with charcode: <<>>'

Unplanned
Last Updated: 21 Dec 2021 10:19 by ADMIN
Created by: Dmitry
Comments: 0
Category: PdfProcessing
Type: Feature Request
0
Add support for Ghost signature algorithms (GOST3411_2012_256 and GOST_R3411_12_512 hash algorithms (OID 1.2.643.7.1.1.2.2 and OID  1.2.643.7.1.1.2.3)) 
Completed
Last Updated: 07 Feb 2022 13:57 by ADMIN
Release R1 2022 SP1

URI Action with invalid mailto URL scheme - mailto:***@***.**(E-mail) can be imported but trying to merge or clone the document throws UriFormatException: 'Invalid URI: The hostname could not be parsed.'

Workaround: Remove the annotations that contain invalid Uri:

PdfFormatProvider provider = new PdfFormatProvider();
this.pdfDocument = provider.Import(memory);

foreach (var page in this.pdfDocument.Pages.ToList())
{
    List<Link> links = page.Annotations.Where(a => a.Type == AnnotationType.Link).Select(a => a as Link).ToList();
    foreach (var link in links)
    {
        Uri uri;
        UriAction uriAction = link.Action as UriAction;

        try
        {
            uri = uriAction.Uri;
        }
        catch (UriFormatException)
        {
            page.Annotations.Remove(link);
        }
    }
}

Unplanned
Last Updated: 25 Jan 2022 11:15 by ADMIN
Created by: Rick
Comments: 0
Category: PdfProcessing
Type: Feature Request
0
Users should be able to copy a table row and add this copy to another table.
Duplicated
Last Updated: 28 Mar 2023 08:29 by ADMIN

When a document containing a SignatureField is exported with the IsEncrypted property set to true, a not set UserPassword is required to open it, which makes it impossible to be opened.

Workaround: Exporting with AES256 encryption does not have this problem:

provider.ExportSettings = new PdfExportSettings
{
	IsEncrypted = true,
	EncryptionType = EncryptionType.AES256
};

 

Unplanned
Last Updated: 15 Feb 2022 11:08 by Salman

 PdfFormatProvider: When Arial Narrow Bold fond is set in the document the font-weight is lost when converting to PDF.

 

Workaround:

var fontData = File.ReadAllBytes(@"C:\Downloads\arial-narrow\arialnb.ttf");
FontsRepository.RegisterFont(new System.Windows.Media.FontFamily("Arial Narrow"), FontStyles.Normal, FontWeights.Bold, fontData);

Completed
Last Updated: 14 Mar 2022 07:31 by ADMIN
Release LIB 2022.1.307 (07 Mar 2021)
When importing a document containing Widget annotation with normal appearance dictionary set to null an exception is thrown:
.../AP<</N<</Off null/Yes 439 0 R>>...
The exception: System.ArgumentNullException: 'Value cannot be null.
Parameter name: form'
Unplanned
Last Updated: 07 Mar 2022 09:20 by Xavi

When a Table consisting of one TableRow that contains a TableCell with a Rowspan > 1 set, additional lines are added to the table.

Table table = new Table();
TableRow row = table.Rows.AddTableRow();
row.Cells.AddTableCell();
TableCell secondCell = row.Cells.AddTableCell();
secondCell.RowSpan = 2;
table.Measure();
table.Rows.AddTableRow();
The result:

Unplanned
Last Updated: 07 Mar 2022 10:06 by Xavi

When a row has two cells and the content of the first one is large, the width of the second cell results in too small value while measuring and its content remains invisible.

Workaround: Set PreferredWidth to the second cell.