Solved

PDFs are greyed out with green Spinner in middle

  • 2 September 2019
  • 19 replies
  • 55 views

Userlevel 3
Badge +16

Hi,

 

Got a ticket in with K2 Support, but just wanted to ask on here in case anyone has had similar.

 

These forms worked fine and rendered PDFs fine in K2 v4.7, since upgrading to K2 v5.3 the forms are generating PDFs which have a grey background and the Green spinner in the middle, almost as if the PDF has not completed rendering before it is finished. As well as the PDFS being grey, some users are showing me examples of the PDF being cut off and also that the rules are not following on after the PDF is created.

 

Changed settings for the converter from Impersonate to Serviceaccount and use Webkit = true and serializedresoucres = true as well.

 

The form is simple and does a PDF SAVE AS Create Method when the button is clicked...

Rule is = execute SAVE AS PDF controls SAVE PDF method

 

K2 suggested adding a timer, which hasn't made any difference either.

 

Any ideas?

Thanks

icon

Best answer by Sello1 6 November 2019, 15:28

View original

19 replies

are you generating PDFs from workflow or forms ? Colleague was solving the same thing within a workflow. And in our case it was simply about setting a delay into a PDF Convert method in the workflow. But cases might be wildly different. So maybe this helps ? 

Badge +9

Hi Sharpsharp1


 


Please see attached kb article: https://help.k2.com/kb001626


 


Regards


Elvis

Badge +7

Hi Sharpsharp1,


 


I seem to recall that you should only enable one of the two options useWebKit or serializeResources. I would suggest setting useWebKit to True and serializeResources to False.


 


Aditionally, you might also want to set warmUpPDFCall to True, since this will add a delay to the SaveAsPDF control to wait for the page to finish rendering.


 


One more thing you can do, and this is when executing the PDF SmartObject directly and using the method "Create from URL", is to add a Conversion Delay of about 10 to 20 seconds, just to make sure it waits that amount of time for the page to finish rendering. You can make some tests in your web browser using F12 Dev Tools (the Networking tab) to see how long it takes the page to finish rendering, and then introduce that amount of delay when executing the PDF SmartObject. This can be done in the Rule on the Form when you execute the SmartObject. Note - it only applies when executing the method "Create PDF from URL", not to the other two methods.


 


You might also want to keep in mind that the SaveAsPDF control doesn't take a snapshot of the page you're currently seeing, what it does is "open a new tab in the background" with the same URL that you have currently open, so make sure the input parameters you specify in the URL will render the page correctly. You can test this by right-clicking the tab in your browser and selecting "Duplicate Tab" - this will open a new tab in your browser and will render the page. Make sure it renders correctly, if it doesn't then the PDF will be rendered the same as in your browser.


 


Kind regards,


Chris

Userlevel 3
Badge +16

Hi all,

Thanks for the replies.

@Tom- we are doing this via forms only, no pdfs are generated via workflows.

@elvis- i have looked that document at least 15 times now, we used it to get logs for the errors which i passed onto k2.

@chris- we are not using Create from URL, its all done on the forms, so using the SAVE AS PDF Control's SAVE PDF Method

As for the two pdf converter settings, we have always had webkit and serialised set to true. Not having them set causes worse problems with PDFs such as messed up formatting and missing pics.

All worked fine in 4.7, yet another upgrade which doesn't ever go smoothly with K2.

How are you supposed to ever develop forms, when you spend the best part of several months bug fixing after every K2 upgrade?

 

EDIT: @Chris, i changed the settings to Webkit = true, serialised = false, pdfwarmup = true and hasn't made the slightest difference to users, same grey background and spinner.

 

One thing to note is, when i submit the form, the PDFs render fine for me...... Everyone else gets grey and half finished PDFs.... I am an admin on the server, but that should not make a difference right?

Badge +7

Hi Sharpsharp1,


 


Sounds like you're a bit upset about some upgrading issues in K2, I can understand your frustration, but we're working towards improving the product so things are bound to get better from here on out.


 


Regarding the PDF Converter Service, I can tell you that it's a third-party program that K2 uses (we didn't develop an in-house solution to create PDFs to save time and development costs) so we're also dependent on that component working correctly.


 


You mentioned you are an admin user, is there a Proxy set up in the K2 Server? Please check the Internet Options proxy settings for the K2 Service account if necessary.


 


As far as I understand, there are 3 ways of creating a PDF of a Form:


 


1) Use a K2 Workflow and execute a SmartObject


2) Execute a SmartObject as a Rule


3) Execute the Save As PDF Control on the Form as a Rule


 


All three options directly use the "PDF Converter" SmartObject, which is located in All Items -> System -> Controls -> SaveAsPDF -> PDF Converter


 


As a test, you can execute this SmartObject directly in K2 Management or using the SmartObject Services Tester Tool. You should use the method "Create PDF from URL" because only that method has the "Conversion Delay" option, and you're welcome to add a delay of 5 - 10 seconds to cater for the page loading performance.


 


As for the input properties, they should be the following:


URL String = URL to the Form


SmartObject Name = PDFFile


SmartObject Method = Create


SmartObject File Property Name = PDF


ID Property Name = ID


File Name = Test


Page Size = A4


Page Orientation = Portrait


Conversion Delay = 5


 


Once you click Execute, the return property should be an ID number (for example 105). Save that number somewhere, then go over to the "PDF File" SmartObject and execute its "Load" method. Input the number you stored earlier (for example 105) and it should return the PDF file you created earlier. Of course, you might need to auto-generate an Item View around this PDF File SmartObject to download the file and open it.


 


By doing this you can easily test different scenarios and see what works for you. Maybe the grey screen pops up because users haven't stored an access token, in which case said users need to open a K2 Form or URL first in order for K2 to create the access token in their browsers before they can proceed to create the PDF.


 


Either way, I don't want to make duplicate work here, if you can provide me with the support ticket number that you logged then I can have a look at the notes in there and provide the support engineer with some help as well.


 


Kind regards,


ChrisW

Userlevel 3
Badge +16

Hi Chris,

 

No proxy used

We use 3) Execute the Save As PDF Control on the Form as a Rule

 

The point is, this form worked fine prior to upgrade and now they don't. Not sure why i need to change the way i use the PDF converter, when method 3 worked without any issues in v4.7 and is still there in K2 Five.

 

There really is only one scenario, I present a form, the user enters the data on said form, they click submit, a rule on the submit does a SAVE PDF method on the PDF control... I am not changing all my forms for a different PDF method, because this should work.

 

On simpler one page forms, the above method is working fine, the longer forms is where the forms are greyed out and has the green spinner on. If i submit either short or long forms, they render ok for me.

 

I have no idea what the cause is, but something is broken since the upgrade and the PDF converter with longer forms and other users.

 

Thanks

Badge +7

Hi Sharpharp1,


 


On your Form(s), what happens in the "When Form is Initializing" Rule? And if it exists, in the rule "When Form is Initialized"?


 


Thanks and kind regards,


Chris

Userlevel 3
Badge +16

Hi Chris,

 

I responded to your previous message, but for whatever the Mods removed my message (i guess k2 don't allow any negativity of their product on the forums)

 

Anyway, in answer to your - what happens in the "When Form is Initializing" Rule?

Nothing happens in this rule in regards to PDF generation. I simply had an AD lookup to pre-fill some user text boxs and check who is allowed entry to the form.

 

There is no "When Form is initalized" rule.

 

What relevance do these rules have with the issue Chris? The PDF is created when a user presses a submit button.

 

I have a couple of questions/points.

1) Why would submissions work ok for me, yet be greyed out for all other users?

2) Some of the other forms with simple text are capturing fine with the same PDF method for all users

3) The forms with more information to capture are the ones greyed out for all other users (except me)

4) Confirmed that this is affecting both the Live and Dev environments, so a bug in 5.3 ???

 

Kind Regards,

Badge +7
Hi Sharpharp1,

I saw your previous to last message was blocked as spam, so I marked it as not spam. You'll notice it should be there if you scroll up.

Apparently you have a call with the support engineer later today, I'll see if I can join that call.

Kind regards,
ChrisW

I was getting ready to create a support ticket for this exact issue. I will wait a couple of days to see if a solution is posted here. Thanks!

Userlevel 3
Badge +16

Update for everyone - We had a K2 support call yesterday with Chris and ticket support and still couldn't fix the issue, so still on-going.

 

My personal feeling is that the K2 5.3 upgrade has broken the forms which were upgraded from v4.7.

The rules are set to "follow on one after the other", but my own tests reveal that this is not the case.

 

For example if i put a message box before the SAVE AS PDF method, logic suggests that you click OK on the box and then the PDF conversation happens after. Reality is, the Message Box is being rendered in the PDF, so the rule sequence is not working properly in the legacy forms as would suggest.

 

This would explain why the PDF is greyed out and the spinner is shown, ots because whatever actions are going on before it are not completing before the PDF conversion happens. i.e. in the live form, i'm saving the form data, perhaps that is still in motion when the PDF conversion happens.

 

Also tried adding a Timer delay of 15 seconds before conversation... the delay was only a couple of seconds, so again this suggests that the sequence of rules is not working in 5.3

 

The amount of troubleshooting i've done for this is ridiculous, in the meantime this doesn't make for a good customer experience for our users.

 

@Lydia, thanks for pitching in, might be interesting to know if you or anyone else could possibly try some of the above tests to confirm whether this is the case for you? I get same results on dev and live environments.

 

Regards,

I agree that something is off with rule timing. I put a Save As PDF rule under the After the Workflow action was submitted rule. My pdf is greyed out with the Worklist item submitted successfully notification displayed. I would expect to have to click OK on the notification to end the worklist task before the Save As PDF rule kicks off.
Badge +7
Hi all,

If you suspect something is wrong with the rule execution, please feel free to test this out. The more information you can give our support team, the better, since we use this information to improve the product and fix bugs.

If you can reproduce the bug in a different environment, you can send our support team clear steps on how to reproduce (for example "deploy this package, click this button") and they can try this themselves. If they do manage to reproduce, they can report back to our Labs team who will then be able to fix the bug.

Here's more information on how to manually troubleshoot Forms during Runtime:

https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#Create/Forms/DebuggingForms.htm%3FTocPath%3DCreate%7CSmartForms%7CForms%7C_____14

Here's a video that explains the above as well:

https://help.k2.com/displaycontent.aspx?id=6241

I would suggest trying to reproduce the issue by rebuilding the Form/View from scratch, and seeing which rule causes it to go wrong.

You can also have a look at the SourceCode.Forms.Runtime.Error log in the K2 BlackpearlHost ServerBin directory, if this is enabled in the Runtime web.config.

Kind regards,
Chris
Badge +3

Hi Sharpharp1,

 

We are experiencing almost the same issue. Was K2 Support able to resolve the issue?

 

Thanks,

Justin

Badge +3

Hi Lydia,

 

We are experiencing almost the same issue. Was K2 Support able to resolve the issue?

 

Thanks,

Justin

A few things you can try (sorry if some is repeating)

1. As many said try up the delay.

 

2. Move all rule execution into load on server rule (if possible).

Result:

PDF is fully white = something wrong is happening in your rules.

Wrong security settings, parameters set wrong as example.

 

Still showing grey spinner: Maybe CombinedResources loaded with an error.

Configure the host file so K2 always call itself on localhost and then do an /iisreset

 

Hope this helps

/Björn

 

Hi Justin,


 


I believe the issue was resoved. If you are exeperiencing the same issue after upgrading from 4.7 to K2 Five, then


follow the below steps to help remedy the issue :


 


- Navigate to K2 Management > Categories > System > Controls > Save as PDF > PDF Converter > Security tab
- Click on "INHERIT PERMISSIONS..." button
- After that Everyone will be configured as follows:
View: Inherited Allow; Modify: Inherited Allow; Delete: Inherited Allow; Security: None


 


This should work for Google Chrome, but if you are on IE you may still experience issue until youclear up the browser cache and do an IIS reset. Additionally,  you may want to clear up IIS cache by means of IIS reset. If the issue still persists,  follow the following steps:


 


1) Clear server side cache:
* Stop K2 Server
* Stop IIS: Run "iisreset /stop"
* Start K2 Server
* Start IIS: Run "iisreset /start"


 


2) If issue still persist for some IE user(s) after performing step (1) - use Ctrl + Shift + Del to invoke IE clear cache dialogue. Clear cache and restart browser.


 


Hope this helps.


 


Regard,


Sello

Badge +3

Thank you, Sello1. You saved us a great deal of time!

 

The steps listed above resolved the issue for us. The one additional step I would add to the directions above is to make sure you run IE/Chrome as the Service Account for K2. The PDF Converter value did not appear for us until we performed that action.


Justin

Badge +7
Hi Justin,

Instead of running your browser as the K2 Service account, you can change the Authentication Mode of the PDF Converter Service Instance from "ServiceAccount" to "Impersonate". Then it will impersonate the user who is executing the Create PDF method.

Kind regards,
ChrisW

Reply