For some documents, the clippings and colors of the geometries are modified on an import-export scenario.
IOException when an object in the cross-reference stream has a negative offset.
"System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file."
When inserting ligature languages text into a block, the text doesn't appear on the generated PDF file.
With the following sample code, the issue can be reproduced:
private static string fileName = "Hello.pdf"; static void Main(string[] args) { byte[] fontData = File.ReadAllBytes("calibri.ttf"); FontFamily fontFamily = new FontFamily("Calibri"); FontsRepository.RegisterFont(fontFamily, FontStyles.Normal, FontWeights.Normal, fontData); RadFixedDocument document = new RadFixedDocument(); RadFixedPage page = new RadFixedPage(); string text = "مرØبا"; var reversedText = text.ToCharArray(); Array.Reverse(reversedText); Block block = new Block(); block.InsertText(new FontFamily("Calibri"), new string(reversedText)); FixedContentEditor editor = new FixedContentEditor(page); editor.DrawBlock(block); document.Pages.Add(page); PdfFormatProvider provider = new PdfFormatProvider(); using (Stream output = File.OpenWrite(fileName)) { provider.Export(document, output); } ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = fileName; Process.Start(fileName); }
Trying to clone the Signature of a SignatureField leads to InvalidOperationException as the FieldName of the cloned signature is already set.
Workaround: Remove the signatures before the merging of the document:
private static void RemoveSignatures(RadFixedDocument document)
{
List<FormField> signatures = document.AcroForm.FormFields.Where(ff => ff.FieldType == FormFieldType.Signature).ToList();
if (signatures.Count > 0)
{
foreach (FormField signature in signatures)
{
document.AcroForm.FormFields.Remove(signature);
}
}
List<SignatureWidget> signatureWidgets = document.Annotations.Where(a => a.Type == AnnotationType.Widget && a.GetType() == typeof(SignatureWidget)).Cast<SignatureWidget>().ToList();
if (signatureWidgets.Count > 0)
{
foreach (var signatureWidget in signatureWidgets)
{
foreach (RadFixedPage page in document.Pages)
{
if (page.Annotations.Contains(signatureWidget))
{
page.Annotations.Remove(signatureWidget);
}
}
}
}
}
Wrong encoding is used when the PDF file contains font with custom encoding
Workaround:
foreach (var widget in field.Widgets)
{
widget.TextProperties.Font = FontsRepository.Helvetica;
}