Skip to main content

This is annoying man...

 

I have a form with some text boxes on.

 

For example, text box 1 can take upto 90 characters. I then use the SAVE as PDF control and when the PDF is rendered, it only shows 47 characters in the PDF...

 

Why is that? Whats the point of having a convert to PDF control if it doesn't capture the screen as it is displayed?

 

Any way round this as it's doing my head in

Dear,

 

Does the lenght of the text  exceed the textbox width??

 


No, the text being entered on screen fits in the text box. But when saved as PDF, it cuts off half of the text.


Dear,

 

It's true I tried it, somehow half of the text disappeard

I suggest you change some stuff in your formview and it will look better if you do the following

 

add datalable to your formview and give it property WRAP TEXT 

 

before saving as PDF add the following rules

 

1 transfare textbox to datalable

2 hide textbox

3 save as PDF

 

 

 

 


Hi Mustafa,

 

This is precisely what i did to get it working, but it tooks me a long time because I have multiple fields....

 

It is a pain having to do a hide, then show for each field and data label. This doubles the amount of controls on the view as well..

 

Surely if the screen is displaying it all, why isn't the PDF taking a snapshot correctly?

 

I feel this needs to be addressed as a bug fix with K2.

 

Mustafa, thanks for your help as always bro.

 

 


Dear,

 

you're most welcome

 

as soon as i find a solution for this i'll let you know ;)


Yep, this is really annoying. 

 

I too had this issue and  my form/view had a 40-50 text boxes, so fixing problem with each one was a big challenge.

I could fix the issue by making changes in the form instead:

  1. Add a hidden data label
  2. In the Form Initializing rule add a Transfter data action as last action
  3. Add the javascript "<script type="text/javascript"> $("textarea").each(function () { this.style.height = (this.scrollHeight+1)+'px'; }); </script>" to the data label

Done!

 

Try to generate the PDF and see if all text is visible in the PDF file. If not, try to increase the scrollHeight in the javascript and try again...

 

Though, it is not a great solution but you can achive this with less changes and making it common than changing each control properties etc. 

 

PS: Using javascript adjusts the height of the textboxes and adds a blank line after the last line in every text box on the form. However, it should not matter much as long as it is acceptable and you can generate PDF as you want. In case, you need to apply the height to some particular text boxes then tweak the javascript to identify those text boxes and apply the height to only those text boxes.

 

 


Reply