Setting the ComplianceLevel to PdfA3B and the TaggingStrategy to UseExisting when exporting a PDF document leads to the following Error reported by VerPdf:
Specification: ISO 19005-3:2012, Clause: 6.2.11.5, Test number: 1 For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and in the embedded font program shall be consistent. Glyph width 274.4140625 in the embedded font program is not consistent with the Widths entry of the font dictionary (value 272)
Resaving a document with Acrobat throws an error due to invalid Info dictionary in document trailer.
You need to explicitly set the correct MIME type when embedding the file into the PDF. This is especially important for standards like PDF/A-3 and Factur-X, which require strict metadata and MIME type declarations for embedded files.
The default value /application/octet-stream is too generic and not compliant for XML attachments.
List's top and bottom margins are not correctly exported.
Workaround: Apply TelerikNormal style to the 'ol' element.
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming;
using Telerik.Windows.Documents.Fixed.Model.Editing;
using Telerik.Windows.Documents.Fixed.Model.InteractiveForms;
using Telerik.Windows.Documents.Fixed.Model;
using Telerik.Documents.Primitives;
using System.Diagnostics;
using System.Reflection.Metadata;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
namespace _1681158PdfInputFields
{
internal class Program
{
static void Main(string[] args)
{
ExportExamplePdfForm();
}
public static void ExportExamplePdfForm()
{
RadFixedDocument fixedDoc = new RadFixedDocument();
RadFixedPage fixedPage = fixedDoc.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(fixedPage);
editor.Position.Translate(100, 100);
TextBoxField textBox = new TextBoxField("textBox");
fixedDoc.AcroForm.FormFields.Add(textBox);
textBox.Value = "Sample text...";
Size widgetDimensions = new Size(200, 30);
DrawNextWidgetWithDescription(editor, "TextBox", (e) => e.DrawWidget(textBox, widgetDimensions));
string fileName = "output.pdf";
File.Delete(fileName);
// File.WriteAllBytes(fileName, new PdfFormatProvider().Export(fixedDoc, TimeSpan.FromSeconds(15)));
string ResultFileName = "result.pdf";
File.Delete(ResultFileName);
using (PdfStreamWriter writer = new PdfStreamWriter(File.OpenWrite(ResultFileName)))
{
foreach (RadFixedPage page in fixedDoc.Pages)
{
writer.WritePage(page);
}
}
ProcessStartInfo psi = new ProcessStartInfo()
{
FileName = ResultFileName,
UseShellExecute = true
};
Process.Start(psi);
Console.WriteLine("Document created.");
}
private static void DrawNextWidgetWithDescription(FixedContentEditor editor, string description, Action<FixedContentEditor> drawWidgetWithEditor)
{
double padding = 20;
drawWidgetWithEditor(editor);
Size annotationSize = editor.Root.Annotations[editor.Root.Annotations.Count - 1].Rect.Size;
double x = editor.Position.Matrix.OffsetX;
double y = editor.Position.Matrix.OffsetY;
Block block = new Block();
block.TextProperties.FontSize = 20;
block.VerticalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.VerticalAlignment.Center;
block.InsertText(description);
editor.Position.Translate(x + annotationSize.Width + padding, y);
editor.DrawBlock(block, new Size(editor.Root.Size.Width, annotationSize.Height));
editor.Position.Translate(x, y + annotationSize.Height + padding);
}
}
}
When exporting a DOCX file to PDF format, the following error message occurs:
Generate a sample document with RadPdfProcessing and export it with AES-256 encryption. Try to open it on an iPhone with the default Pdf Viewer of iOS. The document is empty. However, the mobile version of Adobe for iOS opens the document successfully.
The issue may be reproduced by opening the attached PDF in Adobe Reader. Although the viewer initially shows the characters correctly, when you start typing in the TextBox, the umlaut/diacritics characters get corrupted. In other PDF viewers, the umlaut characters are handled correctly, so the issue seems to related to concrete Adobe Reader encoding handling implementation. The diacritic characters are handled incorrectly in other viewers as well (e.g. Chrome).
When importing a document with an invalid creation or modification date, an exception is thrown: