Image not showing when Export to pdf from Code
Image not showing when Export to pdf from Code
Hello!
I am using "Samples-NET.Core-CSharp-master" sample code project "Export-Report-from-Code"
The invoice report I am creating with this sample has some errors:
- the pdf file doesn't have the logo
- line spacing is less that normal(too close)
(see attachment)
NOTE: these problems are only when I export to pdf from code (when open the report in the viewer then export from there is ok)
Any ideas, suggestions...
I am trying to make a decision to purchase this component and these problems are holding me back.
Thank you
I am using "Samples-NET.Core-CSharp-master" sample code project "Export-Report-from-Code"
The invoice report I am creating with this sample has some errors:
- the pdf file doesn't have the logo
- line spacing is less that normal(too close)
(see attachment)
NOTE: these problems are only when I export to pdf from code (when open the report in the viewer then export from there is ok)
Any ideas, suggestions...
I am trying to make a decision to purchase this component and these problems are holding me back.
Thank you
- Attachments
-
- V95852.pdf
- (29.17 KiB) Downloaded 339 times
Re: Image not showing when Export to pdf from Code
Hello.
What code do you use to export the report?
Do you get image from the same domain?
Could you send us a sample that will help us to reproduce the issue?
Thank you.
What code do you use to export the report?
Do you get image from the same domain?
Could you send us a sample that will help us to reproduce the issue?
Thank you.
Re: Image not showing when Export to pdf from Code
Hi,
The attached project will not reproduce the behavior.
Thank you very much!
The attached project will not reproduce the behavior.
Thank you very much!
- Attachments
-
- WebApplication1.zip
- (4.97 MiB) Downloaded 196 times
Re: Image not showing when Export to pdf from Code
Hello,
So please try to use the logo image in jpeg format.
Thank you.
NodeJS has some limitations and at this moment only images in jpeg format correctly exported to the pdf-file.sorinav wrote:- the pdf file doesn't have the logo
So please try to use the logo image in jpeg format.
Thank you.
Re: Image not showing when Export to pdf from Code
Hi Sorinav,
As for the second part of the question about the issue with the font spacing.
The MeasureString method that is used for the report rendering, has been done with help of the visual components. Node.js does not have these components at all. So all the measurements are done using the openType library.
Node.js does not support any kind of fonts out of the box.
So you need to load all the fonts that are used by the report with help of the following method:
So if one of the report fonts had not been loaded - the report export result would be different as it is clear from your sample project.
So the solution here - is to load all the fonts that the report template is using with help of the above code.
The above mentioned code will help to render the report's fonts in all the environments that are supported, i.e. Mac, Linux, Android & Windows, because the library will process each font as a byte array.
Thank you,
Edward
As for the second part of the question about the issue with the font spacing.
The MeasureString method that is used for the report rendering, has been done with help of the visual components. Node.js does not have these components at all. So all the measurements are done using the openType library.
Node.js does not support any kind of fonts out of the box.
So you need to load all the fonts that are used by the report with help of the following method:
Code: Select all
Stimulsoft.Base.StiFontCollection.addOpentypeFontFile("arial.ttf");
So the solution here - is to load all the fonts that the report template is using with help of the above code.
The above mentioned code will help to render the report's fonts in all the environments that are supported, i.e. Mac, Linux, Android & Windows, because the library will process each font as a byte array.
Thank you,
Edward
Re: Image not showing when Export to pdf from Code
Hi Ivan,
Thank you very much for the tip, Using jpg images solve the problem.
Thank you very much for the tip, Using jpg images solve the problem.
Re: Image not showing when Export to pdf from Code
Hi Edward,
Thank you for the explanations. I will try to load the font as you said. Thank you again!
Thank you for the explanations. I will try to load the font as you said. Thank you again!
Re: Image not showing when Export to pdf from Code
Hi Edward,
The font is loaded but line space remains remains at the same value. Is there any global method to increase or set the line space value? Thank you very much.
Sorin
The font is loaded but line space remains remains at the same value. Is there any global method to increase or set the line space value? Thank you very much.
Sorin
Re: Image not showing when Export to pdf from Code
Hello.
Could you send us your current sample project?
We will answer after analysis of your project.
Thank you.
Could you send us your current sample project?
We will answer after analysis of your project.
Thank you.
Re: Image not showing when Export to pdf from Code
Hi, Attached is the project I use.
Thank you very much.
Thank you very much.
- Attachments
-
- WebApplication1.zip
- (6.38 MiB) Downloaded 312 times