Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PageRanges issue -- printing

HurukanOct 15 2012 — edited Oct 22 2012
Greetings,

I'm trying to print some pages from a pdf document (special thanx to the iText library team) (i.e: 4,9 and 12).
I think I did all good but the printer prints the entire document (bypassing the PrintRequestAttribute object passed to the print() method).

When steppin' into the code, I got the right number of Attributes, and the Attributes map let me check if the PageRanges object is getting the right values: that is the case.
Boolean testPrint=false;
testPrint=Reglages.add(new PageRanges(4));
dpjCSSMBulletins.print(DocToPrint, Reglages);
testPrint=Reglages.remove(PageRanges.class);
testPrint=Reglages.add(new PageRanges(12));
dpjCSSMBulletins.print(DocToPrint, Reglages);
testPrint=Reglages.remove(PageRanges.class);
testPrint=Reglages.add(new PageRanges(9));
dpjCSSMBulletins.print(DocToPrint, Reglages);
Each time the add() and remove() returned "true", and I can see the changes in the debug window in the IDE.
I can't explain why when I'm looking at the printer status (using lpq on Linux) the document to be printed is full (250000 bytes) and when printing I got the first page instead of the fourth... I stopped right there and never went further.

The javadoc information says:
public PageRanges(int member)

    Construct a new page ranges attribute containing a single integer. That is, only the one page is to be printed. 
Is anybody knows if there is limitations or particular bugs using this class ?
Thanx in advance ^^

Comments

cormaco

This must have been answered already,

Yes indeed, you could have searched yourself:

https://community.oracle.com/message/14875278

Paavo

Just to find a quick solution - what is the best way to launch 18.2 sqldeveloper again so that it opens the dialog which asks the path to jdk ?

Can't recall in which mysterious win-directory the config file was where I can fiddle with the java-home stuff.

rgrds Paavo

Paavo
Answer

I got my subversion connections back by downgrading the JDK as follows:

1st downloaded jdk from here: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

pastedImage_0.png

2nd looked hard where the configuration files are for sqldeveloper

For casual sql writer it is not straightforward to drill down to C:\Users\mywinuserx\AppData\Roaming\sqldeveloper\18.2.0

3rd altered the path to java - I remember that the sqldeveloper's new versions typicall ask where it is, but I can't say where it stores that informatiion

and find a product.conf file from there where the path to jdk can be altered e.g. like this:

# SetJavaHome /path/jdk

SetJavaHome C:\opt\Java\jdk1.8.0_181

4th and llaunched 18.2 sqldeveloper and my subversions returned

lets see if everything now works as it used to

During install of the java, noticed that it will have discontinued support for corp. users, so I assume that sqldeveloper will be in sync with java later on.

Btw. it woudl be cool to have the same kind of versioning and releasing for java as we have now for sqldeveloper, apex and ords. Simplicity to filenames and so on

rgrds Paavo

Marked as Answer by Paavo · Sep 27 2020
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 19 2012
Added on Oct 15 2012
1 comment
84 views