Problem while calling PDF file from java
Hi,
In my Java standalone application i need show PDF files.
By using following code I can be able to show PDF files.
String theUrl=""//location of the
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + theUrl);
This is working fine with Acrobat 5, Acrobat 6 and Acrobat 7.
But problem with Adobe Acrobat 8
Cant be able to show PDF files using the above code.
Please help me to resolve to this issue.
Thanks & Regards
TKR
I have the exact same problem as TKR. How do we fix the problem so ADOBE 8.1.2 will work for PDF files?
Similar Messages
-
Exception while calling BPEL process from JAVA
Hi All
I am getting this error while calling BPEL process from JAVA
first I've got javabeans exception then I changed the port to default 23791 .. now I am getting the following
Exception in thread "main" oracle.adf.mds.exception.MDSRuntimeException: Cache not initialized
at oracle.apps.fnd.framework.mds.cache.ATGCacheMgrDelegateImpl.<init>(ATGCacheMgrDelegateImpl.java:325)
at oracle.apps.fnd.framework.mds.cache.ATGCacheFactoryImpl.<init>(ATGCacheFactoryImpl.java:44)
at oracle.apps.fnd.cp.request.CpContext.getMDSContext(CpContext.java:1084)
at oracle.apps.fnd.cp.request.Run.main(Run.java:130)
can anyone helpSorry guys for disturbing.
I deleted the file CacheDefaultConfig.properties by mistake from $JAVA_TOP
I replaced it and it worked fine
Thanks,
Baraa -
Call .bat file from java code
I need to call an application that uses a .bat file to execute from a java program. Is that possible?
This is the .bat file:
importcli.exe ciaf2735 C:\Importcli\files\SAI2735*.txt
importcli.exe ciaf2735 C:\Importcli\files\CI2735*.txt
importcli.exe ciaf2735 C:\Importcli\files\SC2735*.txt
importcli.exe db1800 C:\Importcli\files\*.mdbmagaupe wrote:
I need to call an application that uses a .bat file to execute from a java program. Is that possible?
This is the .bat file:
importcli.exe ciaf2735 C:\Importcli\files\SAI2735*.txt
importcli.exe ciaf2735 C:\Importcli\files\CI2735*.txt
importcli.exe ciaf2735 C:\Importcli\files\SC2735*.txt
importcli.exe db1800 C:\Importcli\files\*.mdb
Hmmm, I wonder what would happen if there were a web search engine and you could research like this:
[http://www.google.com/search?hl=en&q=call+.bat+file+from+java] -
Problem while reading XML file from Aplication server(Al11)
Hi Experts
I am facing a problem while reading XML file from Aplication server using open data set.
OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
IF sy-subrc <> 0.
EXIT.
ENDIF.
READ DATASET v_dsn INTO v_rec.
WHILE sy-subrc <> 0.
ENDWHILE.
CLOSE DATASET v_dsn.
The XML file contains the details from an IDOC number , the expected output is XML file giving all the segments details in a single page and send the user in lotus note as an attachment, But in the present output after opening the attachment i am getting a single XML file which contains most of the segments ,but in the bottom part it is giving the below error .
- <E1EDT13 SEGMENT="1">
<QUALF>001</QUALF>
<NTANF>20110803</NTANF>
<NTANZ>080000</NTANZ>
<NTEND>20110803<The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
/SPAN></NTEND>
<NTENZ>000000</NTENZ>
for all the xml its giving the error in bottom part , but once we open the source code and if we saved in system without changing anything the file giving the xml file without any error in that .
could any one can help to solve this issue .Hi Oliver
Thanx for your reply.
see the latest output
- <E1EDT13 SEGMENT="1">
<QUALF>003</QUALF>
<NTANF>20110803</NTANF>
<NTANZ>080000</NTANZ>
<NTEND>20110803</NTEND>
<NTENZ>000000</NTENZ>
<ISDD>00000000</ISDD>
<ISDZ>000000</ISDZ>
<IEDD>00000000</IEDD>
<IEDZ>000000</IEDZ>
</E1EDT13>
- <E1EDT13 SEGMENT="1">
<QUALF>001</QUALF>
<NTANF>20110803</NTANF>
<NTANZ>080000</NTANZ>
<NTEND>20110803<The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
/SPAN></NTEND>
<NTENZ>000000</NTENZ>
E1EDT13 with QUALF>003 and <E1EDT13 SEGMENT="1">
with <QUALF>001 having almost same segment data . but E1EDT13 with QUALF>003 is populating all segment data
properly ,but E1EDT13 with QUALF>001 is giving in between. -
Problem while dowloading the file from Application Server
Dear Experts,
I am facing the Problem while downloading the file from Application server.
We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
Please help me to solve this issue.
Thanks & Regards,
Srinibut our user will use the Txn. AL11 and they will download from there
Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
Hope i'm clear.
BR,
Suhas -
Viewing and printing a PDF file from Java Swing Application
Hello,
I need to view and print PDF files from Java Swing Application.How do I do that?I appreciate your help.
Thank you
Sumana SomareddyIf you have a link to the URL pointing to the PDF file, you can allow the browser to open it. Then use the print function of the browser to print the PDF document.
Regards,
Tak. -
Problem when loading pdf files from Shared Content
When I load pdf files from Shared Content, I got the following problem: "The selected document could not be retrieved, please try uploading the document again."
Anyone knows this?
Thank you very much in advanced.I don't migrated the program, but installed it from the original installer,
i. e. I first installed Indesign from backup, and then uninstalled it and
reinstall clean from Adobe.
What a plug-in or utility converts page from InDesign to PDF?
2014-08-10 22:51 GMT+04:00 Peter Spier <[email protected]>:
problem with exporting PDF files from InDesign CS5 created by Peter
Spier <https://forums.adobe.com/people/P+Spier> in InDesign - View the
full discussion <https://forums.adobe.com/message/6627440#6627440> -
I wants to call .Exe file from Java Programme
I wants to call .Exe file from Java programme. Please give answer with example. This very urgent. Help me
hi
u can use Runtime.exec() method in java.lang package
to execute exe files
regards
pnp -
How to Call .XDO file From Java Program
Hi,
I have developed a report in using BI Publisher version 10.1.3.
I created the report and it only created XDO files. If I want to call XDO file from Java program how I can do that.
What are the APIs available to do that.
Thanks
-AshutoshHi,
the JavaAPI didn't work with the xdo-Files. But you can create a proxy stub for the Web Service API of BI Publisher which uses the xdo's in the repository.
regards
Rainer -
How to call external files from java?
How to call external files in java. For example how to call a *.pdf file to open in its default editor(say Acrobat), or a *.html file to open in the default browser or a *.txt file in a notepad etc..,
In my program i have *.chm (Compiled Windows HTML Help) help file. how to open it in its default editor it?Jayarathina_Madharasan wrote:
no one answered my questionHi what wrong did i do...basically insulted all the volunteers here who took the time to consider your question and try to offer you help. Other than that, you did nothing wrong.
From JavaRanch :
And even if an answer doesn't solve your problem, even if it should totally miss the point - the best thing to do to motivate others to continue trying to help you is showing respect and gratitude for the investment of time that was put into dealing with your issue.
Edited by: Encephalopathic on Apr 14, 2008 10:01 AM -
Problem when calling a report from java
Hi all,
i have created a report using ireport which contains arabic data.
when i execute the report from ireport to generate a pdf file it works.
however when i call this report from java i have an exception"
Could not create the report Could not load the following font :
pdfFontName : ARIAL.TTF
pdfEncoding : Identity-H"
the pdfFont i used it in ireport, also the pdfEncoding.
did anyone passed with the same problem
thanks for helpHello Oracle experts,
The parameters are getting passed successfully in my report.
But I want to know hous to use it in my query group.
I just want the syntax.
Thanks -
Problem with opening PDF files from JSF page using SDO
Hi all,
I'm new with JSF and was attempting to read a PDF file from a Database using SDO and JSF. The code below throws an exception when casting from DataObject to Blob. The getLcDoc() method was created by WSAD when I dragged an SDO relational record onto the JSF page. This method returns an DataObject type which I tried casting to a Blob type before using it further. However, an exception is thrown.
Any feedback is appreciated.
Arv
try {
FacesContext faces = FacesContext.getCurrentInstance();
HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
Blob file= (Blob)getLcDoc().get("ATTACH");
int iLength = (int)(file.length());
response.setHeader("Content-type", "application/pdf");
response.setHeader("Content-Disposition", "inline; filename=Attachment");
response.setHeader("Expires","0");
response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
response.setHeader("Pragma","public");
response.setContentLength(iLength);
ServletOutputStream os = response.getOutputStream();
InputStream in = null;
in = file.getBinaryStream();
byte buff[] = new byte[1024];
while (true) {
int i = in.read(buff);
if (i<0) break;
os.write(buff,0,i);
os.flush();
os.close();
} catch(Exception ex){
System.out.println("Error while reading file : " + ex.getMessage());
}Hi...I found out that there is actually no need to use a Blob object at all. You can simply call the OutputStreams write() method and pass the DataObject.getBytes() method that returns a byte[] array. The revised code is shown at the end of this posting.
However, a few other teething problems exist:
1. This works well only if I specify the content type in response.setHeader() method. What if my users upload different types of files, is there a way that the browser opens according to the file type without setting the content type?
2. I still have a problem opening PDF files, even if I specify - response.setHeader("Content-type", "application/pdf");
I get the message - The file is damaged and could not be repaired
3. I would also like this to open the attachment in a new window and using target="_blank" doesn't seem to work as seen below:
<h:commandLink
styleClass="commandLink" id="link1" action="#{pc_DocumentDetailsRead.doLink1Action}" target="_blank">
<h:outputText id="text5" styleClass="outputText"
value="Click Here"></h:outputText>
</h:commandLink>
------------------------Revised code-----------------------------------------
FacesContext faces = FacesContext.getCurrentInstance();
HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
response.setHeader("Content-type", "application/msword");
response.setHeader("Content-Disposition", "inline; filename=Attachment");
response.setHeader("Expires","0");
response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
response.setHeader("Pragma","public");
ServletOutputStream os = response.getOutputStream();
os.write(getLcDoc().getBytes("ATTACH"));
os.flush();
os.close(); -
Curious thing while calling a procedure from Java !...
Hi !. My name is Agustin and my doubt would be the following one... I am working for a e-business comp and they asked me to call a procedure from java... The code is the following one:
CallableStatement cs = null;
System.out.println("Fecha Nro. 1: " + paramFechaDesde);
System.out.println("Fecha Nro. 2: " + paramFechaHasta);
try
cs = getDBTransaction().createCallableStatement("{call paq_w_ListadoSiniestralidadART. p_sinsiniest(?,?,?,?) }",0);
cs.registerOutParameter(4,OracleTypes.VARCHAR);
cs.setInt(1,paramContrato.intValue());
cs.setString(2,paramFechaDesde);
cs.setString(3,paramFechaHasta);
cs.setString(4,paramNombreArchivo);
cs.executeQuery();
String nomArchivo = cs.getString(4);
System.out.println("### " + nomArchivo +" ###");
catch(SQLException e)
The weird thing is that, I was expecting a big big exception but the only thing I got is
### Error ###
The String I am expecting is a file's name !; so I am a little bit confused...
Also I didn't know where to post so If it's in the wrong category... I apologize !... If anyone need more details, I'll be checking out... The account I am working on is an Insurance company, who is the one who provide access to the DB and the procedures... So I can't check what's inside...Please provide your Java and OS versions, the JDBC jar file and the Oracle DB version being used when you post.
>
I was expecting a big big exception
>
Then why do you have an empty exception block? That just makes it disappear so you won't see one if it happens.
And your code has
cs.registerOutParameter(4,OracleTypes.VARCHAR);
cs.setString(4,paramNombreArchivo);You use 'registerOutParameter' for an OUT parameter and the 'setXXX' methods for other parameters.
Remove the 'setSTring' for the OUT parameter.
Then as malcollmmc already said
>
Sounds like the PL/SQL is returning "Error" as the 4th parameter of the call
>
The actual value returned by PL/SQL is strictly determined by the PL/SQL code and Java and JDBC are not involved.
Fix the code problems, retest, and folllowup with whoever wrote the code if it still returns ERROR. -
Error accessing PDF files from Java
In CF7, I have a routine that opens submitted PDF files
through Java to do some manipulation. Similar to CF8 PDF
manipulation, but more complex. In almost all cases, it works fine,
except two.
For one, a submitted PDF was corrupted somehow -- I can't
even open it with Acrobat. On the line:
"reader=pdfReader.init(pdfFile);" this returns the error below.
This is expected. But with a couple other PDF's, that do open fine
in Acrobat, I get the same error. I even re-saved the PDF file to
different versions of Acrobat, but java still complains. Any ideas
what causes this, or what to do to prevent it?
Does anyone know if CF8 java processing does anything
different here that would prevent problems like this?
reader=pdfReader.init(pdfFile);
An exception occurred when instantiating a java object. The
cause of this exception was that: .
From the stack trace:
java.lang.reflect.InvocationTargetException
at
sun.reflect.GeneratedConstructorAccessor48126.newInstance(Unknown
Source)It does always happen after having successfully done others,
as these are in a list of about a dozen that it processes at a
time... but it is always consistent - it does all the others fine,
and then always breaks on these particular PDF files, time after
time, day after day. So it's not a random thing that comes and
goes.
The 3rd party tool is the one that's "built-in" to CF,
com.lowagie.text.pdf.PdfReader. This is all on a shared host, and
so I wouldn't have access to installing alternatives. -
Error while Generating PDF file from Datagridview .
Hi every one,
I'm trying to generate pdf file from datagridview,while executing my code getting nullvalue exception..
Here is my code:
private void btnexportPDF_Click(object sender, EventArgs e)
//Creating iTextSharp Table from the DataTable data
PdfPTable pdfTable = new PdfPTable(dataGridView1.ColumnCount);
pdfTable.DefaultCell.Padding = 3;
pdfTable.WidthPercentage = 30;
pdfTable.HorizontalAlignment = Element.ALIGN_LEFT;
pdfTable.DefaultCell.BorderWidth = 1;
//Adding Header row
foreach (DataGridViewColumn column in dataGridView1.Columns)
PdfPCell cell = new PdfPCell(new Phrase(column.HeaderText));
cell.BackgroundColor = new iTextSharp.text.BaseColor(240, 240, 240);
pdfTable.AddCell(cell);
//Adding DataRow
foreach (DataGridViewRow row in dataGridView1.Rows)
foreach (DataGridViewCell cell in row.Cells)
pdfTable.AddCell(cell.Value.ToString());//nullvalue exception
//Exporting to PDF
string folderPath = "C:\\PDFs\\";
if (!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
using (FileStream stream = new FileStream(folderPath + "DataGridViewExport.pdf", FileMode.Create))
Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();
pdfDoc.Add(pdfTable);
pdfDoc.Close();
stream.Close();
Thanks & Regards RAJENDRAN MHi Rajendran,
The second question is about the usage of iTextSharp library, which is not a MS product, please post in their forum for help:
http://support.itextpdf.com/forum
Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
I Have my own Apple ID on my computer and would like to create a new one for my mum on my computer so I can transfer all her contacts etc. How do I do this ?
-
How to restore pictures from an iphone 4 to my ipad?
I erased everything from my iPhone 4and gave it away; so i dont have it anymore. All my pictures from my iPhone got erased too but i need to get them back onto my iPad. I do have an iCloud account and i did put it on my ipad, the iPad does recognize
-
Set a variable in modify package - BPC 7.0 SP4 - Netweaver version
Hi, can anyone tell me how to set a value (constant) for a variable in the modify package? In Import standard package I want to avoid to ask to user for a transformation file name: I want to substitute: PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transfo
-
How to play music in car from Iphone 5s
How do I play music from 5s in my car ? Do I need something to connect to the cigarette lighter as there is no USB.
-
Photoshop CS4 tool box strange behaviour
Hi, one of our designer has this strange thing happening in Photoshop CS4 on her mac. When she moves her cursor on the side tool box and clicks (single click and not holding the button) on the brush tool, she will have all related tools (brush, penc