Code Monkey home page Code Monkey logo

Comments (4)

pcorless avatar pcorless commented on August 17, 2024

As work around you could cast PrintHelperFactoryImpl#createPrintHelper to (PrintHelperImpl). But to your point the print(java.awt.Graphics, java.awt.print.PageFormat, int) probably should be defined as abstract in the base class or the base class implements Printable as you suggested. I'll have to think about this a bit, at the moment it's not clear to me if one approach is better then the other.

Can you provide any more detail as to why you are calling print(java.awt.Graphics, java.awt.print.PageFormat, int) directly, I'm curious as this usually done by the DocPrintJob ?

from icepdf.

tg-freigmbh avatar tg-freigmbh commented on August 17, 2024

If I understand our spaghetti correctly: In "our" Printjob we put multiple printable things together (Plain-Text,Html, Graphics, and 1 or more pdfs . This gets done by passing the printgraphics around to each module/by using the Printable interface.
Using DocPrintJob seems like the better solution if all you want to do is printout the pdf document. However In our case the pdf is only part of a bigger printout.

from icepdf.

pcorless avatar pcorless commented on August 17, 2024

Thanks for the information. I think it would be best to have PrintHelper extend Printable so that you have a proper instance. I'll ready a PR for you to review.

from icepdf.

pcorless avatar pcorless commented on August 17, 2024

Merged fix

from icepdf.

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.