You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Rob Bradley (JIRA)" <ji...@apache.org> on 2009/08/10 17:50:14 UTC

[jira] Created: (PDFBOX-502) How To: compile for .NET for image support..

How To: compile for .NET for image support..
--------------------------------------------

                 Key: PDFBOX-502
                 URL: https://issues.apache.org/jira/browse/PDFBOX-502
             Project: PDFBox
          Issue Type: Improvement
    Affects Versions: 0.8.0-incubator
         Environment: Building for .Net 
            Reporter: Rob Bradley
            Priority: Trivial
             Fix For: 0.8.0-incubator


I hope I have categorized this correctly...

In order to take advantage of image support in PDFBox (ie to add an image to a page) you must compile with at least IKVM ver 0.40.0.1

The older version returns an error "Not Implemented" when creating image objects like "org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg"

The new version supports the java.awt.image library a little better.

However, the new IKVM requires some changes to the build.xml file becease the IKVM file names changed.

I probably have over referenced the dll's but this works.

For each of the build.NET portions of build.xml:
Replace 
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.ClassLibrary.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />

With
            <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Charsets.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Corba.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Core.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Jdbc.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Management.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Misc.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Security.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.SwingAWT.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Text.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Util.dll" />
            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.XML.dll" />



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (PDFBOX-502) How To: compile for .NET for image support..

Posted by Daniel Wilson <wi...@gmail.com>.
Have you tried dropping a few of those references?  Jdbc and Corba do not
appear likely to be needed.

Thanks.

Daniel

On Mon, Aug 10, 2009 at 11:50 AM, Rob Bradley (JIRA) <ji...@apache.org>wrote:

> How To: compile for .NET for image support..
> --------------------------------------------
>
>                 Key: PDFBOX-502
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-502
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>         Environment: Building for .Net
>            Reporter: Rob Bradley
>            Priority: Trivial
>             Fix For: 0.8.0-incubator
>
>
> I hope I have categorized this correctly...
>
> In order to take advantage of image support in PDFBox (ie to add an image
> to a page) you must compile with at least IKVM ver 0.40.0.1
>
> The older version returns an error "Not Implemented" when creating image
> objects like "org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg"
>
> The new version supports the java.awt.image library a little better.
>
> However, the new IKVM requires some changes to the build.xml file becease
> the IKVM file names changed.
>
> I probably have over referenced the dll's but this works.
>
> For each of the build.NET portions of build.xml:
> Replace
>            <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.ClassLibrary.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
>
> With
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
>            <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Charsets.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Corba.dll"
> />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Core.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Jdbc.dll" />
>            <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Management.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Misc.dll" />
>            <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Security.dll" />
>            <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.SwingAWT.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Text.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Util.dll" />
>            <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.XML.dll" />
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

Re: [jira] Commented: (PDFBOX-502) How To: compile for .NET for image support..

Posted by Daniel Wilson <wi...@gmail.com>.
I think the build.NET target in the ant script will work for you now to get
PDFBox working under .Net.  I've been using it there for some time ... but
occasionally have to tweak that part of build.xml as changes are made in the
product.

I understood the original question to refer to rendering PDF's as images in
.Net.  If so, what is required is:

   1. The IKVM-compiled .Net dll of PDFBox and supporting binaries
   2. A class that inherits PageDrawer and overrides most of its methods.
   This is b/c you're not drawing to a Java Graphics object but to a
   System.Drawing.Graphics ... or something like that ... details are escaping
   me tonight.

hth

Daniel

On Mon, Sep 7, 2009 at 11:36 AM, Rob Bradley (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/PDFBOX-502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752177#action_12752177]
>
> Rob Bradley commented on PDFBOX-502:
> ------------------------------------
>
> I am not familiar enough with it either.
>
> However, I am not certain it matters.
>
> In theory (at least my theory) as it compiles if it needs to use a
> component from one of the dll's then it would reference it within the
> compiled dll version.  In a .net application, any call to one of these
> procedures that would require the .net application to reference the
> corresponding ikvm dll as well.
>
> Therefore, compiling with all of them referenced should not change the
> PDFBox dll at all.  I guess it would be equivalent to using a sledge hammer
> to compile an application that you could use a finish hammer on.  Not
> elegant but, if you were to start using some java that required one of them
> you would not change the ant script.
>
> FYI, I am writing a .net class to create PDF reports on the fly.  It may be
> useful to other PDFBox users as well. I have added support for landscape
> text as well.
>
>
> Rob Bradley
> MIS Manager
> Truckee-Tahoe Lumber Co.
> Email:  rob@ttlco.com
> Phone:  (530) 582-2125
> Mobile: (530) 308-6188
> Fax:    (530) 582-2135
>
>
>
> > How To: compile for .NET for image support..
> > --------------------------------------------
> >
> >                 Key: PDFBOX-502
> >                 URL: https://issues.apache.org/jira/browse/PDFBOX-502
> >             Project: PDFBox
> >          Issue Type: Improvement
> >    Affects Versions: 0.8.0-incubator
> >         Environment: Building for .Net
> >            Reporter: Rob Bradley
> >            Priority: Trivial
> >   Original Estimate: 0h
> >  Remaining Estimate: 0h
> >
> > I hope I have categorized this correctly...
> > In order to take advantage of image support in PDFBox (ie to add an image
> to a page) you must compile with at least IKVM ver 0.40.0.1
> > The older version returns an error "Not Implemented" when creating image
> objects like "org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg"
> > The new version supports the java.awt.image library a little better.
> > However, the new IKVM requires some changes to the build.xml file becease
> the IKVM file names changed.
> > I probably have over referenced the dll's but this works.
> > For each of the build.NET portions of build.xml:
> > Replace
> >             <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.ClassLibrary.dll" />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll"
> />
> > With
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll"
> />
> >             <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Charsets.dll" />
> >             <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Corba.dll" />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Core.dll"
> />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Jdbc.dll"
> />
> >             <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Management.dll" />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Misc.dll"
> />
> >             <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Security.dll" />
> >             <arg
> value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.SwingAWT.dll" />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Text.dll"
> />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Util.dll"
> />
> >             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.XML.dll"
> />
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (PDFBOX-502) How To: compile for .NET for image support..

Posted by "Rob Bradley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752177#action_12752177 ] 

Rob Bradley commented on PDFBOX-502:
------------------------------------

I am not familiar enough with it either.

However, I am not certain it matters.

In theory (at least my theory) as it compiles if it needs to use a component from one of the dll's then it would reference it within the compiled dll version.  In a .net application, any call to one of these procedures that would require the .net application to reference the corresponding ikvm dll as well.

Therefore, compiling with all of them referenced should not change the PDFBox dll at all.  I guess it would be equivalent to using a sledge hammer to compile an application that you could use a finish hammer on.  Not elegant but, if you were to start using some java that required one of them you would not change the ant script.

FYI, I am writing a .net class to create PDF reports on the fly.  It may be useful to other PDFBox users as well. I have added support for landscape text as well.


Rob Bradley
MIS Manager
Truckee-Tahoe Lumber Co.
Email:  rob@ttlco.com
Phone:  (530) 582-2125
Mobile: (530) 308-6188
Fax:    (530) 582-2135



> How To: compile for .NET for image support..
> --------------------------------------------
>
>                 Key: PDFBOX-502
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-502
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>         Environment: Building for .Net 
>            Reporter: Rob Bradley
>            Priority: Trivial
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> I hope I have categorized this correctly...
> In order to take advantage of image support in PDFBox (ie to add an image to a page) you must compile with at least IKVM ver 0.40.0.1
> The older version returns an error "Not Implemented" when creating image objects like "org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg"
> The new version supports the java.awt.image library a little better.
> However, the new IKVM requires some changes to the build.xml file becease the IKVM file names changed.
> I probably have over referenced the dll's but this works.
> For each of the build.NET portions of build.xml:
> Replace 
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.ClassLibrary.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
> With
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Charsets.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Corba.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Core.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Jdbc.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Management.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Misc.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Security.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.SwingAWT.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Text.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Util.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.XML.dll" />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-502) How To: compile for .NET for image support..

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751931#action_12751931 ] 

Andreas Lehmkühler commented on PDFBOX-502:
-------------------------------------------

I' not familar with this IKVM stuff. What do I have to do to test if a dll is needed or not? Is it possible to check this during compiling or do I have to run the exe?

> How To: compile for .NET for image support..
> --------------------------------------------
>
>                 Key: PDFBOX-502
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-502
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>         Environment: Building for .Net 
>            Reporter: Rob Bradley
>            Priority: Trivial
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> I hope I have categorized this correctly...
> In order to take advantage of image support in PDFBox (ie to add an image to a page) you must compile with at least IKVM ver 0.40.0.1
> The older version returns an error "Not Implemented" when creating image objects like "org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg"
> The new version supports the java.awt.image library a little better.
> However, the new IKVM requires some changes to the build.xml file becease the IKVM file names changed.
> I probably have over referenced the dll's but this works.
> For each of the build.NET portions of build.xml:
> Replace 
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.ClassLibrary.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
> With
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Charsets.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Corba.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Core.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Jdbc.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Management.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Misc.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Security.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.SwingAWT.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Text.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Util.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.XML.dll" />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-502) How To: compile for .NET for image support..

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler updated PDFBOX-502:
--------------------------------------

    Fix Version/s:     (was: 0.8.0-incubator)

> How To: compile for .NET for image support..
> --------------------------------------------
>
>                 Key: PDFBOX-502
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-502
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.8.0-incubator
>         Environment: Building for .Net 
>            Reporter: Rob Bradley
>            Priority: Trivial
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> I hope I have categorized this correctly...
> In order to take advantage of image support in PDFBox (ie to add an image to a page) you must compile with at least IKVM ver 0.40.0.1
> The older version returns an error "Not Implemented" when creating image objects like "org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg"
> The new version supports the java.awt.image library a little better.
> However, the new IKVM requires some changes to the build.xml file becease the IKVM file names changed.
> I probably have over referenced the dll's but this works.
> For each of the build.NET portions of build.xml:
> Replace 
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.ClassLibrary.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
> With
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.AWT.WinForms.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Charsets.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Corba.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Core.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Jdbc.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Management.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Misc.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Security.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.SwingAWT.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Text.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.Util.dll" />
>             <arg value="-reference:${ikvm.dir}/bin/IKVM.OpenJDK.XML.dll" />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.