Giter VIP home page Giter VIP logo

Comments (10)

donbwhite avatar donbwhite commented on June 19, 2024

Encountering this issue as well. Hope it can be patched.

@plaetzchen79 in case it helps I did downgrade to 0.9.0 to check just in case it was related to issue 22 since that seemed related to the printOpenWindow but had the same behavior. Wanted to report and rule that out for you.

from ngx-printer-demo.

plaetzchen79 avatar plaetzchen79 commented on June 19, 2024

Sorry for beeing late.
Do you have any console error output?
What happend? Does the print dialog appear - or nothing happens?

from ngx-printer-demo.

Prabin1111 avatar Prabin1111 commented on June 19, 2024

NO error message in console
screen recorded link
https://drive.google.com/file/d/1XLSnXNhtyJIlzsUyHR69-_U2Ey8gmi0n/view

from ngx-printer-demo.

plaetzchen79 avatar plaetzchen79 commented on June 19, 2024

Thank you!!
Call me blind or stupid-but i cant figure out..

  1. The print window opens in the current window
  2. Content is shown
    3.. it closes correctly and returns to the window

But in 2):
The content is not correct- the content of a shared component is missing?

from ngx-printer-demo.

plaetzchen79 avatar plaetzchen79 commented on June 19, 2024

or is it the fact that a new window opens?

in this case can you try this:

  printHTMLElementToCurrent() {
    this.printerService.printOpenWindow = false;
    this.printerService.printHTMLElement(this.PrintComponent.nativeElement);
    this.printerService.printOpenWindow = true;
  }

from ngx-printer-demo.

donbwhite avatar donbwhite commented on June 19, 2024

I would assume that if printOpenWindow was set to false then the new tab/window would not open and it would just open up the browsers print.

from ngx-printer-demo.

plaetzchen79 avatar plaetzchen79 commented on June 19, 2024

ahh ok forRoot parameter false boolean check..i will fix this

from ngx-printer-demo.

plaetzchen79 avatar plaetzchen79 commented on June 19, 2024

please try Version 0.9.2

from ngx-printer-demo.

Prabin1111 avatar Prabin1111 commented on June 19, 2024

load print page by Ctrl + P
What we are expecting
https://drive.google.com/file/d/1Iyo9M0L-pkXiTjiFGaDarHoAhIOHs6_i/view`

load print page by library service this.printerService.printHTMLElement(this.PrintComponent.nativeElement);
what we get
https://drive.google.com/file/d/1Iyo9M0L-pkXiTjiFGaDarHoAhIOHs6_i/view

also thank you for response

I will try 0.9.2 and info soon

from ngx-printer-demo.

Prabin1111 avatar Prabin1111 commented on June 19, 2024

@plaetzchen79

The print window/box open in the current window

but the content of page is now blank

https://drive.google.com/file/d/1rAJf2AmPJVUDb2tjw4nk0Cib1X6-DqK4/view

Am i doing it wrong way or need to add more config

in app.module
NgxPrinterModule.forRoot({printOpenWindow: false});

HTML
<button (click)="printHTMLElementToCurrent()">print</button> <app-print #printContainer ngxPrintItem directPrint="true"> <app-print-header> <app-print-header-mock-up></app-print-header-mock-up> </app-print-header> <app-print-body> <app-print-body-mock-up> </app-print-body-mock-up> </app-print-body> <app-print-footer> </app-print-footer> </app-print>

component
`@ViewChild('printContainer', {read: ElementRef}) PrintComponent: ElementRef | undefined;

constructor(private printerService: NgxPrinterService) { }
ngOnInit(): void {
}
printHTMLElementToCurrent(): void {
this.PrintComponent &&
this.printerService.printHTMLElement(this.PrintComponent.nativeElement);
}`

from ngx-printer-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.