Sharpharp1
Apprentice

PDFs are greyed out with green Spinner in middle

Jump to solution

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

0 Kudos
Reply
19 Replies
Tom-C
Novice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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 ? 

0 Kudos
Reply
ElvisJacob
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

Hi Sharpsharp1


 


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


 


Regards


Elvis

0 Kudos
Reply
ChrisW2
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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

0 Kudos
Reply
Sharpharp1
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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?

0 Kudos
Reply
ChrisW2
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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

0 Kudos
Reply
Sharpharp1
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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

0 Kudos
Reply
ChrisW2
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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

0 Kudos
Reply
Sharpharp1
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution

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,

0 Kudos
Reply
ChrisW2
Apprentice

Re: PDFs are greyed out with green Spinner in middle

Jump to solution
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
0 Kudos
Reply