Export to PDF does not support foreign Language - c#

I am doing export to PDF functionality, it works perfect as i want , but it is not supporting gujarati language, Gujarati language data is not getting visible in PDF file.
I am using iTextSharp.dll for export to PDF.
Any suggestions will be highly appreciable.

Related

Write PDF other than English language C#.Net or Angular

I have been trying to read a pdf file and convert it into another language selected by user via Google API. then I need to save the translated content to another file.
I have generated pdf file using c#.net and Angular but both are only supporting English language while most probably I have to translate file from English to other languages.
I have used jsPDF for angular and for C#.Net I have used UglyToad.PdfPig but I am not able to save other languages
did you try other PDF generation libraries?
i use PDFFlow and I know it supports latin, cyrillic and asian languages
For example this simple code creates Chinese text :
{
DocumentBuilder.New()
.AddSection()
.AddParagraph("在这输 在入文这输 入文字")
.SetFontEncodingName(EncodingNamesChineseSimplified.GBK_EUC_H)
.SetFontName(FontNamesChineseSimplified.SimSun).ToDocument()
.Build("Result.pdf");
}
the result pdf will be this:
try and tell me if you need further help or have any questions

Simple Template Based PDF Reports in .Net

My customer gave me some Word and Powerpoint documents which specify how certain 'reports' generated by our product are supposed to look like.
That means, I need to modify those documents (replace placeholders etc.) and then I need to export them as PDF.
How would you solve this problem in C# ?
TL;DR: Editing the office document is no problem at all, but exporting that document to PDF (using Interop) allegedly causes issues when running it as a web server application. That's the whole problem here.
I agree that Interop is not suitable for document manipulation in server environment. I would approach this problem by preparing MS Word template documents with placeholders for data. Then I would use c# to load the data for the reports and merge the data with templates to get final documents (docx, pdf, xps or various image formats). There are 3rd party toolkits which make it quite easy. Here is the code used by one such toolkit needed for merging xml data with the template to get a pdf document:
XElement customers = XElement.Load("Customers.xml");
DocumentGenerator dg = new DocumentGenerator(customers);
DocumentGenerationResult result = dg.GenerateDocument("MyTemplate.docx", "MyReport.pdf");
You can of course also use free libraries and SDKs based on OpenXML but you should expect a steep learning curve, lots of debugging and lots of time invested.
Wkthmltopdf might be an option.
A completely different "report approach" could be, to save those office documents with the placeholders as mht (That's MHTML a web archive format). This could be done directly in MS Office or even programatically.
The placeholders could be easily exchanged by string search and replace. The mht files could directly be used to show the report instead of the PDF. A clear disadvantage of the mht format, is the HTML formatting. With PDF you have a clear and fix positioning.
We are using this kind of report creation. There are some flaws, but it works and the customer could edit the mht templates directly by right-click Open-With the prefered MS Office flavor.
You can use report generators, like FastReport.Net for solving your problems. It can assign different data for placeholders and also allow export to PDF.

Exporting a SSRS 2008 report to RTF

I am using Microsoft.ReportViewer to display SSRS reports from my C# desktop application. The ReportViewr by default provides the 3 modes of export features, 1. Excel. 2. Word, 3. PDF. Now we want another export capability of RTF. Does any one have any idea how to convert the SSRS reports to RTF format?
SQL Server Reporting Services does not support RTF as a rendering format out of the box. If you want this functionality you have two options:
1) Develop a custom rendering extension
or
2) Buy a third-party solution, for example this one
If you can export it to a word file, you can use the word interop to read the file, select all, copy and paste to a richtextbox. You can get the rtf format from the RTF property of the richtextbox.

CSV, Excel, PDF Report Generator for Mysql, .net 4.0

I am in a strange juncture, where I need to generate reports in Excel, PDF and CSV formats.
I got it working for CSV format. but have no clue on how to generate Excel and PDF reports.
I am sure I dont have to re-invent the wheel to do all this stuff.
I can not use SSRS etc, as they are only for SQL Server.
Could some one please suggest a good reporting tool for Mysql?
You can use open source ClosedXML, а wrapper around OpenXML to conveniently generate xlsx files - i.e. Office 2007+ format Excel files. Can't help with PDF, but you can search codeplex for it too.

How can I convert PDF to doc without microsoft.office.interop?

I need to convert PDF files into .doc files using C#. The computer has no file system though it doesn't have Office installed. Any good ideas how I can approach this? I did some research and most of people use the interop services.
You need to understand that PDF is not really implemented as a single document format.
If your PDF docs are created by rendering text to a PDF file, then direct PDF conversion is not only possible, but can be very good (reliable).
If the source of your PDF is either a scanner or fax (essentially a scanner...) then what you have is a document with an "picture" of text. This scenario is more difficult to deal with. If you open up the markup for this there is no 'text' to be converted. In this situation you have to deal with some manner of OCR (optical character recognition) which is less reliable due to a variety of issues.
If you have the option of intercepting the data before it is rendered to PDF (say like in SSRS or Crystal) then it would be better for you to bypass the PDF stage and move your data to a Word document.
If you are constrained to receiving faxes and then needing to interpret their content, prepare for OCR hell. It has been a while since I was there, so I hope that it has gotten better.
Even with out office installed on your machine, you have access (with Visual Studios) to the Office developer toolkit which will allow you build documents to be distributed in the Word formats.(.doc/.docx).
An option/idea may be to convert the PDF to Html, which can be opened in Word?
use aspose pdf kit to conver pdf to text and then text to doc using filestream or aspose doc

Categories