Thanks, Maruan. The big thing to avoid is direct access to a graphics object in an object other than PageDrawer. I inherit from PageDrawer and override many of the methods, and I believe anyone else who wishes to use PDFBox for rendering in .Net would need to do the same.
A big hint that direct access to a graphics object is coming is a line of code like Graphics2D graphics = (PageDrawer)context.getGraphics(); If that line tries to execute in .Net ... it will return a NULL ... and then you get NullPointerExceptions. Better to keep the graphics code in PageDrawer. The refactoring of some of the Font stuff I'm about to commit doesn't completely do this ... but it does provide a getawtFont routine that can be called from .Net, permitting the actual graphics stuff down in PDSimpleFont to be avoided. Daniel On Fri, Apr 9, 2010 at 2:44 PM, Maruan Sahyoun <[email protected]>wrote: > Hi Daniel, > > as I'm currently looking at implementing support for some more text > rendering modes in PageDrawer (PDFBOX-678) I would like to understand if > that might affect the .NET Version. Although I don't have a completed > version this is a list of the potential operations I will be using. > > * generating a Shape based on TextLayout.getOutline() > * filling, drawing and clipping using that Shape > * possibly AlphaComposite > * possibly GlyphVector > > Are there things I should avoid? > > Kind regards > > > Maruan Sahyoun > > Am 09.04.2010 um 18:18 schrieb Daniel Wilson (JIRA): > > > > > [ > https://issues.apache.org/jira/browse/PDFBOX-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855454#action_12855454] > > > > Daniel Wilson commented on PDFBOX-688: > > -------------------------------------- > > > > 928957 -- Make page and pageSize available (again) for > libraries/applications that inherit. > > 931616 -- Stroke & line width/style modifications. > > 931633 -- Invoke / drawImage > > 932179 -- Don't fail to BLACK quite so quickly ... do some more > intelligent guessing. > > Necessary when implementing in .Net as there are still > some key things IKVM is missing. > > > >> Refactoring rendering-related classes/methods for extensibility > >> --------------------------------------------------------------- > >> > >> Key: PDFBOX-688 > >> URL: https://issues.apache.org/jira/browse/PDFBOX-688 > >> Project: PDFBox > >> Issue Type: Improvement > >> Reporter: Daniel Wilson > >> Assignee: Daniel Wilson > >> Priority: Minor > >> > >> Some of the classes/methods in the rendering area assume they have > access to a Graphics2D object. > >> This assumption breaks when using the .Net version of PDFBox. Some > judicious refactoring permits PageDrawer to be extended in .Net and key > methods to be overriden. > >> I am continuing this refactoring for better rendering support in .Net. > >> Andreas recently asked that code committed to SVN also be tied to a Jira > issue -- a good idea really -- so I'm putting this in as an issue. > > > > -- > > This message is automatically generated by JIRA. > > - > > You can reply to this email to add a comment to the issue online. > > > >
