Text fields should support rich text strings allowing the user to use rich text elements and attributes.
Provide a way to change the Name of a FormField from the RadDocument.AcroForm.FormFields collection. As a workaround, you could create a new instance of a FormField with the desired name, add the new field in the document and remove the old one. You can use the following approach: 1) Create a new instance of FormField (with the desired name, passed in the constructor), which will play the role of a copy of a specific FormField 2) Copy all properties from the original field (they all vary, depending on the concrete type of the FormField, for example CheckBoxField, etc.) 3) Create a new widget for the new field, and copy all properties from the original field's widget into the new one. 4) Remove the original field from the RadDocument.AcroForm.FormFields collection and add the new field. 5) Remove the original widget from the corresponding page's annotation and add the new one. Attached is a project demonstrating this approach for a CheckBoxField.
Currently, a default constant value is used for the font size in this scenario.
CryptographicException is thrown when saving with PdfStreamWriter or importing with PdfFormatProvider.
The exception: System.Security.Cryptography.CryptographicException: 'The input data is not a complete block.'
According to the PDF specification:
A clipping path operator (W or W*) may appear after the last path construction operator and before the path-painting operator that terminates a path object.
Invalid:
W % clipping path operator 0 0 m % start of the path construction 596 0 l 596 842 l 0 842 l h % end of the path construction n % path-painting operator
0 0 m 596 0 l 596 842 l 0 842 l h W n
Currently (in the invalid cases), the path construction is skipped on import.
System.OutOfMemoryException: Insufficient memory to continue the execution of the program. at System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount) at System.Text.StringBuilder.AppendWithExpansion(Char value) at System.Text.StringBuilder.Append(Char value) at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Utilities.CrossReferenceCollectionReader.GetAllText(Reader reader, Int64 minOffset, Int64 maxOffset) at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Utilities.CrossReferenceCollectionReader.FindAllObjectOffsets(Reader reader, Dictionary`2 tokenToOffsets, Int64 minOffset, Int64 maxOffset)
This is the code for inserting the image:
static void Main(string[] args)
{
FixedExtensibilityManager.ImagePropertiesResolver = new ImagePropertiesResolver();
//Telerik.Windows.Documents.Extensibility.JpegImageConverterBase defaultJpegImageConverter = new Telerik.Documents.ImageUtils.JpegImageConverter();
//Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = defaultJpegImageConverter;
//Output("fyb-64.png", "output-working.pdf");
Output("fyb.png", "output-broken.pdf");
}
private static void Output(string resourceName, string outputFileName)
{
var document = new RadFixedDocument();
using (var editor = new RadFixedDocumentEditor(document))
{
Stream image = new FileStream(resourceName, FileMode.Open);
var table = new Table
{
LayoutType = TableLayoutType.FixedWidth,
Margin = new Thickness(10, 0, 0, 0),
};
var row = table.Rows.AddTableRow();
var cell = row.Cells.AddTableCell();
var block = cell.Blocks.AddBlock();
block.InsertImage(image);
editor.InsertTable(table);
var pdfData = ExportToPdf(document);
File.Delete(outputFileName);
File.WriteAllBytes(outputFileName, pdfData);
Process.Start(new ProcessStartInfo() { FileName = outputFileName, UseShellExecute = true });
}
}
private static byte[] ExportToPdf(RadFixedDocument document)
{
byte[] pdfData;
using (var ms = new MemoryStream())
{
var pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.Export(document, ms);
pdfData = ms.ToArray();
}
return pdfData;
}
Workaround: Instead of setting the ImagePropertiesResolver, set the JpegImageConverter:
Telerik.Windows.Documents.Extensibility.JpegImageConverterBase defaultJpegImageConverter = new Telerik.Documents.ImageUtils.JpegImageConverter();
Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = defaultJpegImageConverter;
Currently RadPdfProcessing allows setting standard fonts using FontsRepository static properties. However, in RadWordsProcessing font can be set only by specifying FontFamily, FontWeight and FontStyle. As there is no way to set standard fonts this way, API users cannot benefit from using these fonts which may help them achieve smaller PDF size as standard fonts may not be embedded. The same applies to RadSpreadhProcessing as well.
Implemented import and export of IccBased, Indexed, Cmyk color spaces. Available in Q3 2015. Available in R2 2018 Official Release version.
When characters are in the ranges 61472-61566, 61565-61695, 65535-65535 they are correctly exported with Wingdings font. However, when the character value is outside these ranges the font fallback mechanism exports them with different font and this causes wrong glyph rendering in the resulted PDF.
The following code snippet shows how the Wingdings characters can be modified so that they are correctly exported to PDF when converting from WordsProcessing's RadFlowDocument:
RadFlowDocument document = new DocxFormatProvider().Import(File.ReadAllBytes(@"test_document.docx"));
foreach (Run run in document.EnumerateChildrenOfType<Run>())
{
if (run.FontFamily.GetActualValue(document.Theme).Source.Contains("Wingdings"))
{
StringBuilder modifiedText = new StringBuilder();
foreach (char character in run.Text)
{
modifiedText.Append(character > 256 ? character : (char)(character + 61440));
}
run.Text = modifiedText.ToString();
}
}
Workaround: When creating a RadFixedDocument:
using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(this.fixedDocument))
{
byte[] data = File.ReadAllBytes(@"CustomFont.ttf");
FontsRepository.RegisterFont(new FontFamily("CustomFont"), FontStyles.Normal, FontWeights.Normal, data);
FontBase customFont;
FontsRepository.TryCreateFont(new FontFamily("CustomFont"), FontStyles.Normal, FontWeights.Normal, out customFont);
editor.CharacterProperties.Font = customFont;
string text = "w";
StringBuilder modifiedText = new StringBuilder();
foreach (char character in text)
{
modifiedText.Append(character > 256 ? character : (char)(character + 61440));
}
text = modifiedText.ToString();
editor.InsertRun(text);
}