Hi,
I have some issues converting doc or docx files to pdf.
Attachment has the code sample and 2 documents.
Problem_with_footer.docx after transformation does not render bold chars and does not display footer at all..
Changes_Signature_position.doc after transformation the position of Signature place is not correct.
Any help would be appreciated
Thanks
John
Hello
We have an existing extensive report created with a RadFixedDocument for saving as pdf. We would like to allow users to add content from multiple TelerikEditors to the report, as comments. The TelerikEditor exports html. I have seen this post: https://www.telerik.com/forums/telerik-blazor-pdf-processing---tutorial-on-how-to-add-markup-html-in-a-string-to-a-pdf
Is there any other way to add HTML snippets in a PDF report, or should we rewrite the entire report as a RadFlowDocument? Is there an other way to convert some basic HTML to elements we can use on Block.
Thanks
-Edo
Hello,
I would like to ask if I can add watermark to a pdf document generated from a docx file and signed digitally without invalidating the signature.
Thank you
We are licensed user and have been trying to convert HTML into PDf using telerik. But while doing so we are loosing certain CSS styles. we are unable to wrap the text in column header and use <hr> in the pdf document. Is there any possible way to do it ?
Hello
I'm trying to implement a simple page counter in my generated document to display "Page x of y" in the footer.
I tried to use the PAGE and NUMPAGES fields, as explained in this article: https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/concepts/fields/page-field, but the NUMPAGES field doesn't update and I get "Page x of " instead.
I also tried the workaround suggested in this forum post: https://www.telerik.com/forums/table-headers-page-numbers, but the result is inconsistent - when testing on the same document I get either a count of 8 or 9, even though it's always the same document and always eight pages long.
How can I get the total number of pages in the generated document?
My current code:
RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
//Business logic
PdfFormatProvider provider = new PdfFormatProvider();
RadFixedDocument fixedDocument = provider.ExportToFixedDocument(document);
int count = fixedDocument.Pages.Count;
Footer footer = document.Sections.First().Footers.Add();
editor.MoveToParagraphStart(footer.Blocks.AddParagraph());
editor.InsertText("Page ");
FieldInfo pageFI = editor.InsertField("PAGE", "1");
editor.InsertText($" of {count}");
document.UpdateFields();
using (MemoryStream output = new MemoryStream())
{
Telerik.Windows.Documents.Extensibility.FontsProviderBase fontsProvider = new FontsProvider();
Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.FontsProvider = fontsProvider;
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.Export(document, output);
return output.ToArray();
}
Hello,
I'm currently testing the Telerik PDFProcessingLibrary and I wanted to try out the example as described in your documentation https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/getting-started
I have created a simple console application in .NET 6 in VS Professional 2022 version 17.3.6.
The code is the following:
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.Model;
using Telerik.Windows.Documents.Fixed.Model.Editing;
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
editor.DrawText("Hello RadPdfProcessing!");
PdfFormatProvider provider = new PdfFormatProvider();
using (Stream output = File.OpenWrite("Hello.pdf"))
{
provider.Export(document, output);
}
If I add the references manually from the Telerik installation on my PC, I receive the following exception:
If I add them using NuGet, it's the following exception:
Do you have an idea from where it can come? Do you need further information in order to help out?
Thank you in advance and have a nice day!
Jana
Hello! I am having an issue with missing bold font styling when using the HtmlFormatProvider to export an HTML string to a PDF byte array. All other CSS styles work as expected in the creation of some relatively complex forms, but the bold formatting is missing from the resultant PDF document (see attached image).
Currently using version 2020.2.615 of Telerik.Documents & related NuGet packages (upgrade may not be possible due to some legacy restrictions, so would ideally like to resolve without)
Using the following code with an example string, we save the byte array as a database record and the document is downloaded on request by the user.
// sample string
var stringToConvert = "<div><span>Here is some text. And here is some <b>bold</b> text... maybe?</span></div><div><span>Here is some text. And here is some <strong>bold</strong> text... maybe?</span></div><div><span>Here is some text. And here is some <span style=\"font-weight:bold;\">bold</span> text... maybe?</span></div>";
HtmlFormatProvider provider = new HtmlFormatProvider();
RadFlowDocument document = provider.Import(stringToConvert);
// Export document
PdfFormatProvider byteProvider = new PdfFormatProvider();
return byteProvider.Export(document);
Thank you,
Jeff
Dear Telerik Team,
We encounter an issue with export html data to pdf file using below code. For example,
using Telerik.Web.UI;
using OpenXmlSpreadsheet = DocumentFormat.OpenXml.Spreadsheet;
using Pdf = Telerik.Windows.Documents.Flow.FormatProviders.Pdf;
using te = Telerik.Windows.Documents.Flow.FormatProviders.Html;
using tm = Telerik.Windows.Documents.Flow.Model;
using tp = Telerik.Windows.Documents.Primitives;
using tt = Telerik.Windows.Documents.Spreadsheet.Theming;te.HtmlFormatProvider provider = new te.HtmlFormatProvider();
tm.RadFlowDocument document = provider.Import(HttpUtility.HtmlDecode(htmldata));
tt.ThemeFontScheme fs = new tt.ThemeFontScheme("Arial", "Helvetica", "sans-serif");
tt.DocumentTheme theme = new tt.DocumentTheme("PDF", document.Theme.ColorScheme, fs);
document.Theme = theme;
document.Sections[0].PageMargins = new tp.Padding(50, 25, 50, 25);
Pdf.PdfFormatProvider providerPdf = new Pdf.PdfFormatProvider();
byte[] fileBytes = providerPdf.Export(document);
"providerPdf.Export(document);" this line throws exception "An exception occurred during a WebClient request" whenever we include <img src="/image path/image.png" /> html tag.
Your support is appreciated.
I am trying to use Telerik document processing to append some text to an existing pdf document. The text is in Arabic language, that is, it is Unicode and it has right to left direction. The resulted pdf document does not show the text even though I can it render the text if I changed the text to English.
Does Telerik pdf document processing library support Arabic text?