Case-sensitive imports conflict

R

Ross Presser

Background:

I am trying to make use of the pdfbox library (www.pdfbox.com), which is a
java-based project that the user has ported to dotnet using the ikvm
environment (www.ikvm.net). IKVM in turn relies on a port of the GNU
Classpath library, which implements much of the standard java 1.4.

My problem:

GNU classpath supplies the following classes that pdfbox needs:

java.awt.image.BufferedImage
java.awt.Image

They appear in the same assembly, IKVM.GNU.Classpath.dll, and can both be
seen in the Object Browser after I reference that assembly from my vb.net
project.

Unfortunately, any attempt to use java.awt.image.BufferedImage in my code
is highlighted as a compile error (and reported as a compile error when
building:)

PdfToImageVB.vb(254): Type 'java.awt.Image.BufferedImage' is not defined.

Although both Image (type) and image (namespace) can be seen when scrolling
through intellisense, if you stop at java.awt.image it is captialized to
java.awt.Image.

When I use Sharpdevelop to set up a C# project, I do not have this issue,
but Sharpdevelop has the same issue for a VB.NET project.

Is there anything I can do? I don't enjoy developing in C#...
 
K

Ken Tucker [MVP]

Hi,

I am not sure why you are having problems with the pdfbox library.
I have used the open source sharppdf library with vb.net without any
problems.

http://sharppdf.it/home.asp

Ken
--------------------------
Background:

I am trying to make use of the pdfbox library (www.pdfbox.com), which is a
java-based project that the user has ported to dotnet using the ikvm
environment (www.ikvm.net). IKVM in turn relies on a port of the GNU
Classpath library, which implements much of the standard java 1.4.

My problem:

GNU classpath supplies the following classes that pdfbox needs:

java.awt.image.BufferedImage
java.awt.Image

They appear in the same assembly, IKVM.GNU.Classpath.dll, and can both be
seen in the Object Browser after I reference that assembly from my vb.net
project.

Unfortunately, any attempt to use java.awt.image.BufferedImage in my code
is highlighted as a compile error (and reported as a compile error when
building:)

PdfToImageVB.vb(254): Type 'java.awt.Image.BufferedImage' is not defined.

Although both Image (type) and image (namespace) can be seen when scrolling
through intellisense, if you stop at java.awt.image it is captialized to
java.awt.Image.

When I use Sharpdevelop to set up a C# project, I do not have this issue,
but Sharpdevelop has the same issue for a VB.NET project.

Is there anything I can do? I don't enjoy developing in C#...
 
H

Herfried K. Wagner [MVP]

Ross Presser said:
java.awt.image.BufferedImage
java.awt.Image

They appear in the same assembly, IKVM.GNU.Classpath.dll, and can both be
seen in the Object Browser after I reference that assembly from my vb.net
project.

Unfortunately, any attempt to use java.awt.image.BufferedImage in my code
is highlighted as a compile error (and reported as a compile error when
building:)

PdfToImageVB.vb(254): Type 'java.awt.Image.BufferedImage' is not defined.

Although both Image (type) and image (namespace) can be seen when
scrolling
through intellisense, if you stop at java.awt.image it is captialized to
java.awt.Image.
[...]
Is there anything I can do?

Ask the library's author for a CLS-compliant version. MSDN:

| For two identifiers to be considered distinct, they must differ
| by more than just their case.
 
R

Ross Presser

Ross Presser said:
java.awt.image.BufferedImage
java.awt.Image

They appear in the same assembly, IKVM.GNU.Classpath.dll, and can both be
seen in the Object Browser after I reference that assembly from my vb.net
project.

Unfortunately, any attempt to use java.awt.image.BufferedImage in my code
is highlighted as a compile error (and reported as a compile error when
building:)

PdfToImageVB.vb(254): Type 'java.awt.Image.BufferedImage' is not defined.

Although both Image (type) and image (namespace) can be seen when
scrolling
through intellisense, if you stop at java.awt.image it is captialized to
java.awt.Image.
[...]
Is there anything I can do?

Ask the library's author for a CLS-compliant version. MSDN:

| For two identifiers to be considered distinct, they must differ
| by more than just their case.

Thank you for the answer. Unfortunately, it seems unlikely they will do
this, since the effort is to be compatible with java ...

I will have to write at least part of it in C#.
 
R

Ross Presser

Hi,

I am not sure why you are having problems with the pdfbox library.
I have used the open source sharppdf library with vb.net without any
problems.

http://sharppdf.it/home.asp

SharpPDF appears to be only for creation of new PDFs; for that purpose I am
content with iText.NET, which seems much more full-featured.

pdfbox, however, is supposed to add investigation of the structure of
existing PDFs, as well as pdf rendering.

My problem is at heart not with pdfbox, but with the IKVM port of GNU
Classpath.
 
H

Herfried K. Wagner [MVP]

Ross Presser said:
Thank you for the answer. Unfortunately, it seems unlikely they will do
this, since the effort is to be compatible with java ...

I will have to write at least part of it in C#.

I think it's the best solution to keep the part using the library in a C#
project too.
 
K

Ken Tucker [MVP]

Hi,

http://www.codeproject.com/showcase/TallComponents.asp

Ken
----------------
Hi,

I am not sure why you are having problems with the pdfbox library.
I have used the open source sharppdf library with vb.net without any
problems.

http://sharppdf.it/home.asp

SharpPDF appears to be only for creation of new PDFs; for that purpose I am
content with iText.NET, which seems much more full-featured.

pdfbox, however, is supposed to add investigation of the structure of
existing PDFs, as well as pdf rendering.

My problem is at heart not with pdfbox, but with the IKVM port of GNU
Classpath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top