Strange characters on pdf when generating a pdf.

Stimulsoft Reports.WEB discussion
Post Reply
rjorge99
Posts: 37
Joined: Tue Feb 28, 2023 6:24 pm

Strange characters on pdf when generating a pdf.

Post by rjorge99 »

Hi, I am generating a pdf directly in a path, but the report appears with strange characters.

Any Idea why is happening this?

The code I am using is the next one:

Code: Select all

         var stream = new System.IO.MemoryStream();
            var report = new StiReport();
            report.Load(Server.MapPath("~/Formats/PedidoV2.mrt"));
            report.Render();

            var es = new StiPdfExportSettings();
            report.ExportDocument(StiExportFormat.Pdf, stream, es);

            using (var fileStream = new FileStream(Server.MapPath("~/report.pdf"), FileMode.Create, FileAccess.Write))
            {
                stream.WriteTo(fileStream);
            }

I attach the the sample project I am using, with the report inside.


Thanks
Attachments
ExportPdf.zip
(66.21 MiB) Downloaded 132 times
Captura.PNG
Captura.PNG (26.42 KiB) Viewed 1905 times
rjorge99
Posts: 37
Joined: Tue Feb 28, 2023 6:24 pm

Re: Strange characters on pdf when generating a pdf.

Post by rjorge99 »

Hi,

I found out it is a custom font Im using and adding as a resource to the report.

At my company we use Report.JS, and I dont have any problems with exporting to different formats.


The main issue was that I needed to save the pdf into a specific directory, so they told me I needed to use the Web version for that, even I found out about other people using Report.JS and been able to send info to the Server to create the file, and after asking why the code was without content after following other people code (viewtopic.php?t=62261), or how could I do to use Report.JS and save the report in the Server Side (sending the stringified memorystream) I was told to use the Web version.


Thanks
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: Strange characters on pdf when generating a pdf.

Post by Lech Kulikowski »

Hello,

You can use any server side of the JS, for example, Node.JS:
https://github.com/stimulsoft/Samples-R ... or-Node.js

Thank you.
Post Reply