Open AndersGerner opened 7 years ago
Can you share your code please.
@EddyVerbruggen I cannot share all of it, since it contians confidential information about my client but let me try and see if I can give you all the code you need.
Here is a test app: https://www.dropbox.com/s/9b4p3z4po3cszxk/ns-printer-test.zip?dl=0 I sets up a htmlview and writes "Hello Eddy" 10 times as a H1. It only shows 5 of them in the print view.
Let me know if there are anyting else you need from me :)
I could easily create a PDF with jsPDF and hand that off to the printer if that's an easier solution :)
I think that's a great plan. The HtmlView doesn't seem to want to play nice. Would you be able to turn it into an image instead so you can use the readily available printImage
function?
Maybe - I have a webview longer than the example, that I need to print. Maybe I should try and google for a HTML -> Image, and try that, but it would still be several pages. Can it handle that?
@EddyVerbruggen Would something like this: https://github.com/tsayen/dom-to-image work? I won't have a real image, but a data representation of the image.
@EddyVerbruggen Sorry for stalking you, but I really need your input. :)
I'm not sure what the question was. Do you want me to try something for you?
@EddyVerbruggen I'm a bit pressured on time in my current project, and they demand to be able to print the whole webpage of my webview. For some reason the standard window.print doesn't work, and I, therefore, would like to use your plugin.
As you stated, the HTMLView does not play nice with this plugin, and since PDF is not a possibility (yet) you suggested to use an image.
What I need to know is: Would I be able to use something like https://github.com/tsayen/dom-to-image to get a data representation of the image, in this printer plugin? :)
Thank you very much for your help so far!
I understand, but answering that would require me to test that for you. Did you try printing an image that would be about the same size as the one you'd get from dom-to-image?
No, I haven't tried that. I wanted to see if you would say with certainty that the data representation wouldn't work because it needed to be a real image. I didn't want to waste time. :)
I have tried to create both a WebView and a HTMLView, but even though the HTMLView has a height above 700, it still only shows one page.
Are those views not supported?