Developer forum

Forum » CMS - Standard features » pdf=true breaking the layout

pdf=true breaking the layout

Hans Ravnsfjall
Hans Ravnsfjall
Reply

I have a shop receipt that i want to be printable/pdf´able via pdf=true.

When I use the browser print function, the design is as it should be. However, when i use pdf=true - the design breaks, and info gets stacked.

See video here https://www.screencast.com/t/sBdqCnxSeG1Q

Is this a bug, or am i doing something wrong? Or how can i force pdf=true to behave like the browser native print function?

 

/Hans


Replies

 
Nicolai Pedersen
Reply

Hej Hans

Jeg tror du bruger flexbox og det har pdf=true det dårligt med da det er en ældre webkit browser der bruges. Så du kan prøve med noget mere gammeldags html...

Heldigvis er det pdf component vi bruger skiftet til Chrome som gør at det renderer det samme. Vi har liiige opgraderet den i sidste uge og det kommer ud med 9.13. Pakken er ikke tilængelig endnu på nuget, men det er en provider som du kan skifte ud. Men den er altså ikke helt klar endnu.

 

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hej Nicolai,

Jeg oplever samme problem med Printable paper, at tingene lægger sig oveni hinanden.
Har du/I nogen ETA for provideren til Nuget?

--
Med venlig hilsen
Kurt Moskjær Andersen

 
Nicolai Pedersen
Reply

Hi

We are in test mode on this - and we need the correct distribution license which we are awaiting. Also we just received an update of the pdf component with several bug fixes which we need and an update chrome engine.

But hopefully within a week.

BR Nicolai

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Brilliant 👍 looking forward to it being released

will it come as part of a regular version update? If not, how can i implement it?

 

/Hans

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Sounds good, Nicolai.

I've fixed it temporarily by overwriting the flexbox styling, to use the old block-structure instead.

/Kurt

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Looking forward to it, and we will implement it as soon as it´s awailable :)

Nicolai, how can we implement it once it´s available? WIll it require a regular full version update, or will there be some other way of implementing it?

/Hans

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Any update on how and when we can use this?

/Hans

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

bump :) Any news?

/Hans

 
Nicolai Pedersen
Reply

Yes - you need to replace the pdf provider with this version:

https://www.nuget.org/packages/Dynamicweb.Imaging.Providers.IronPdfProviders/2.0.0

Or better yet, upgrade to latest 9.12

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Think there is a bug in version 9.12.9

this is what i get when adding pdf=true

 

System.Exception: Pdf creator constructor exception ---> IronPdf.Exceptions.IronPdfNativeException: Error while initializing Chrome renderer: 'Timeout while initializing Chrome renderer'. To learn how to solve this issue please read https://iron.helpscoutdocs.com/article/163-ironpdf-native-exception [Issue Code IRONPDF-NATIVE-EXECPTION] at IronPdf.Engines.Chrome.ChromeClient.() at System.Lazy`1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy`1.get_Value() at .RenderPdfDocumentFromUri(ChromePdfRenderOptions Options, ChromeHttpLoginCredentials Login, Uri url) at Dynamicweb.Imaging.Providers.IronPdfProviders.IronPdfRendererProvider.RenderFromRequest(PdfRequest request, PdfRendererSettings settings) at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize) --- End of inner exception stack trace --- at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize) at Dynamicweb.Frontend.PageView.Output()

 

 

/Hans

 

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Hans,

I just went through that too. Here are the details: https://doc.dynamicweb.com/forum/cms-standard-features/cms-standard-features/exception-with-ironpdf-licensing

The solution for now (until Visual C++ runtime is included with the platform) is to install the Visual C++ runtime on the web server. Then perform an app pool recycle on the site for it to fully work.

Of the 7 or so times that I installed it, 4 times installed quickly and successfully. 2 times installed and said that a reboot was needed, but I continued without the reboot and it was ok. And 2 times the installer locked at about the 50% mark and never continued even though I waited a while. I didn't have any luck cancelling or waiting for it, but it worked after a reboot. Hopefully you'll get one of the successful runs.

Scott

 

You must be logged in to post in the forum