I have a need where i have to know the exact height of the document. I can only know this when the pages are rendered which is fine, but i also need to set the height of the whole document dynamically then in order for the content to stretch all available pages. Right now im using basically 2 same templates merging them but on the first one im setting visibility
hidden, and on the second, setting body height to something like 100% * number of pages, since 100% references height of one page. Is there a more elegant way of doing this, instead of using 2 separate templates which are basically the same?
candy-man
@candy-man
Posts made by candy-man
-
Need for rendering same page 2
-
RE: Merge existing pdfs from api call to newly generated pdf
Thank you very much! Worked like a charm
-
RE: Merge existing pdfs from api call to newly generated pdf
My backend is in dotnet and i'm calling RenderByNameAsync() method
-
Merge existing pdfs from api call to newly generated pdf
Is there a way i can send an already generated pdf via post call to jsreport where jsreport can generate a new pdf and merge it with the one that was sent via api?
-
RE: Complex use case access translations
Amazing thank you! I suppose the resource approach will have to suffice until then.
-
Complex use case access translations
Im using the complex use case for accessing translations. As i see it the way to access the text you just need to use something like this:
{{translate "text1"}}
The question is how do i access data when i have to access property of an object?
{
"text1: "value1",
"object": {
"text2": "value2"
}
}
How would i access the "text2" value with translate method? -
RE: Set viewport height and viewport width from api call (dotnet)
This was exactly what was needed! Thank you very much!
-
RE: Set viewport height and viewport width from api call (dotnet)
I tried that first something like this:
var renderRequest = new jsreport.Types.RenderRequest
{
Template = new Template
{Name = "compare", ChromeImage = new ChromeImage { ClipX = 0, ClipY = 0, ClipHeight = 100, ClipWidth = 150, } }, Data = new { DataSeries = this.ChartService.DataSeries, Currency = this.ChartService.Currency, CultureName = this.ChartService.CultureName, SeriesColors = this.seriesColors, FontSize = this.ChartService.CustomSettings["fontsize"] }, };
but the result is that the height and width are set as default then 800 and 600 so when i clip it i get part of the picture
![alt text]( image url)
i need to change these values
![alt text]( image url)
i can't seem to find how to do this
-
Set viewport height and viewport width from api call (dotnet)
Is there a way to achieve this, I'm using handlebars, chrome-image
In dotnet using jsreport.Client im calling something like this but it doesn't work:
var renderRequest = new jsreport.Types.RenderRequest
{Template = new Template { Name = "compare", Chrome = new Chrome { Width = $"{100}px", Height = $"{150}px", }, }, Data = new { DataSeries = this.ChartService.DataSeries, Currency = this.ChartService.Currency, CultureName = this.ChartService.CultureName, SeriesColors = this.seriesColors, FontSize = this.ChartService.CustomSettings["fontsize"] }, };
for chrome image I see I can only set clip sizes but I want to set the viewport width and height as a whole