PDF Output Problem

I have a servlet that takes a file from the server, reads its bytes with the FileInputStream, and writes them to the ServletOutputStream. The types we allow are pdf, tif, doc, and xls. The only problem I am coming across is some PDF files won't come up with the browser showing a 'File is damaged and could not be repaired' error dialog. The pdf itself seems fine. We can open it in Adobe Reader, and drag and drop it into the browser. It only seems to occur when running it through this servlet and only some PDFs, not all. I pasted relevant code below. It seems pretty basic to me.
Thanks,
Karl
out = response.getOutputStream();
file = new File(ApplicationData.getVar("DocumentPath")+attachedDoc.getPath());
response.setContentType(mimetype);
response.setHeader("Content-Disposition","inline");
// Get input stream for reading raw bytes
FileInputStream in = new FileInputStream(file);
byte[] bytes = new byte[10000];
// Read in file and at the same time write the stream to the resposne.
while((in.read(bytes)) != -1) {
     out.write(bytes);
in.close();
out.flush();
out.close();

Guess they are opting for something close to 8K
instead. Interesting.If by "they" you mean the reference in reply 7 above, the "they" is me. And my 8k value isn't very scientific. It's more like tradition from when disk blocks were usually 2k-8k. When accessing a disk, you may get improved performance when using disk block sizes or multiples thereof. For really kick a$$ performance (e.g. implementing a "cp" command), query the file system for its block size and use that unless the size is completely silly (statfs(2) system call in Unix gets the underlying block size).
When writing to a socket, the buffer size matters less. The Nagle algorithm will collect several writes to bigger packets, and the underlying network will require splitting up bigger writes.
Unless you are streaming lots of data over a gigabit net, your CPU will be able to keep the network card and the wire saturated at pretty much any buffer size. Maybe at less than, say, 100 bytes the CPU load will go measurably up. A couple of kB should be fine.

Similar Messages

  • Report fonts mapping and PDF output problem(Easten European languages)

    Hi experts,
    I have such a problem.
    If i run oracle reports(10g) via reports builder all layouts looks fine.
    When i run them in PDF format via application server - report text and numbers strech out off frames, also textfields and text itself becomes bigger in size.
    Aplication server runs over windows OS.
    Uifont.ali file looks:
    [ PDF:Subset ]
    Arial..Italic.Bold.. = "Arialbi.ttf"
    Arial...Bold.. = "Arialbd.ttf"
    Arial..Italic... = "Ariali.ttf"
    Arial..Plain... = "Arial.ttf"
    Arial..... = "Arial.ttf"
    "Times New Roman"...Bold.. = "TIMESBD.TTF"
    "Times New Roman"..Italic... = "TIMESI.TTF"
    "Times New Roman"..... = "TIMES.TTF"
    I think the problem is with Lithuanian(baltic) letters in the text. If i do not map fonts in uifont.ali file i get PDF report without the
    lithuanian alphabet letters, but in this case it looks fine(The same as in report builder)
    After fonts mapping, i get my lithuanian alphabet letters, but text and numbers strech out off frames, changes the size and etc.
    I put the example of my report uotput:
    http://pirmas.50webs.com/index.html
    What else can i do to solve this problem?
    Thanks for any suggestions
    Sky_lt

    Vangel
    For the html output issue , there is a patch available on top of 9021. Please contact your Oracle support representative to get a 90211 patch nd apply the one-off patch of Bug 2472932.
    For PDF, please ensure that you are setting the NLS_LANG in the server config file using the dynamic environment switch feature introduced in 90 patch 1 (9021). Please see the patch 1 release notes for the details
    Thanks
    The Oracle Reports Team

  • Pdf output problem in ALV Block Display

    Hi ,
    I have z custom report of ALV BLOCK LIST DISPLAY which creates Spool using ABAP submit statement and then this spool is feed to FM CONVERT_ABAPSPOOLJOB_2_PDF to create PDF file . PDF file generates but output is coming on two pages. I want to display output on same page(i.e. on first page only) .
    it's urgent, appriciate your help.
    Thanks & Regards
    MSI

    while displaying in the screen is it display in one screen and while converting in PDF is IT Does the same in Two Pages

  • Two Color Pdf Output Problem - Continued

    From yesterday's post, it was determined that my pdfs were in fact two color, but it turns out the printer is taking the individual pdf pages and marrying them up in printer pagination format using Illustrator. Could this be way the black is converting to RGB? What software should he be using?
    Thank you,
    Tony

    Unproper Color Calibration settings can lead to this problem.
    tomaxxi
    http://indisnip.wordpress.com/

  • Two Color Pdf Output Problem

    I'm new with InDesign coming from a Quark background. I created a 28 page booklet with CMYK cover and two color interior (black & PMS spot color)
    I'm working in CS4 and my print vendor is CS3. I have provided him with both the InDesign file saved down to .inx as well as high quality pdf with no color conversion so that the spot color will print as is.
    My print vendor is telling me that the black screens/gradients are separating as RBG. I'm trying to figure out if the problem is my inexperience or his. I don't know what more to do with the file? Please advise.
    Thank you,
    Tony

    Okay, I'm back to this issue. Apparently the printer is taking the individual pdf pages and marrying them up to printer pagination using Illustrator. Could this be why the Black is converting to RGB? What software should he be using to maintain the two colors?
    Thank you,
    Tony

  • Problem with PDF output quality

    We recently upgraded to CS4 Suite Design premium and i am having problems getting illustrator to print high quality output.  I have a file created in illustrator which contains 300dpi tiff images created in photoshop (CMYK colorspace in both photoshop image and illustrator file)  when i print this file to pdf everything looks hi-rez except these images.  i have attempted adjusting all the obvious settings in the print dialoge box including:  Output/Printer Resolution, Graphics/Postscript level, Advanced/overprint and transparency flattener options/custom settings.  and nothing has worked.  Other things i have noted, is that in the print dialog box the only presets listed are Custom, Default and Default Web/Video/Mobile.  I have looked through the online help files and found the info on how to add "High Quality Print" to my adobe pdf presets, however it doesn't work.  furthermore i have tried the instructions here: http://help.adobe.com/en_US/Illustrator/14.0/WSA79FA899-BC95-401e-BD44-5B26BC31B369.html  where it says to move the files from "Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Application Support\Adobe PDF"  however there is no folder called "Application Support" on my system.  I have run out of ideas.
    The odd thing here, is that i can take the AI file into photoshop, and print a "High Quality Print" from photoshop with no problems, but i'd like to remove this step to speed up my workflow.
    I've attached both the high-quality pdf output from photoshop and the low-quality pdf output from illustrator for reference. (look closely at the logo's)

    Figured it out myself! yay!  (only took my entire moring)
    The solution:
    Dont print to PDF!
    SAVE AS COPY, then select Adobe PDF and click SAVE, this will bring up a dialog box with the options you need (including the "High Quality Print" Adobe PDF Preset)
    This was not clear in any of the instructions i read

  • Problems viewing concurrent request pdf output on mac os

    Please your advice on this will be much appreciated.
    A user can run a c.request and view the pdf output on windows without problems. When she uses mac, she is able to run the request successfully but gets error if she click on the link to see the output. Are there any parameters etc to be changed to use mac os?
    Thanks

    Do you meet the requirements of the "Certification Matrix for Safari" as outlined in the following note?
    Note: 285218.1 - Recommended Browsers for Oracle E-Business Suite 11i
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=285218.1

  • Arabic output pdf file problem

    Hi
    I have tried to print a report through oracle application server 10g, but the ARABIC pdf output printed form left to right which is wrong (The correct is from right to left for Arabic).
    And the same report we printed in HTML file is appeared OK, that means the report is OK and the problem is in pdf file only.
    could anyone help me please?
    bye

    Hi
    Please could anyone send me a respond?
    I haven't received a respond for three days.
    by.

  • HELP!! PDF output repot problem

    We have a report run from a link on a web page that returns a PDF file created by an Oracle Report. I made a change to the static text on the report and now I get this error:
    REP-1610547602 Unable to retrieve a string from the Report Builder message file
    I have searched Metalink but the suggested solutions haven't worked. This report was fine, but we have had a DB and App Server upgrade since the last time it was compiled. We have always compiled on a Windows box and ftp to the UNIX app server. Apparently there is a bug for PDF output, but the work arounds I found on Metalink either haven't worked or I don't know how to do what was indicated (changing font size).
    I believe this error is occurring because of some default value somewhere that is now causing an error. I need to fix this because it's a production report.
    TIA
    John Caputo
    [email protected]

    Have you checked the cache or reports output directory on the reports server if it's actually a blank report?
    I have seen in other threads that there are problems with some Acrobat Reader 6 versions. The plugin for Internet Explorer doesn't seem to work properly. Check the version on the clients.

  • Problem with number-fields in PDF Output Using FOP

    When generating PDF Output using FOP as described in the utilitiy provided in the HTMLDB Studio http://htmldb.oracle.com/pls/otn/f?p=18326:44:12104450162492733947::::P44_ID:1522
    formatted numbers over 1,000 are resolved as characters (because of the comma) and are therefore right justified. This results in alignment issues for numeric columns.
    Does anyone have any ideas on how to work around this.
    Thanks,
    David

    Hello,
    Your probably going to have to edit the xslt to get the result either by stripping out the comma or by setting that column to explicitly align the way you want it.
    Carl

  • Problem  in PDF output in Chinese

    Moved to correct forum.  Please select the correct forum for your questions in future.
    Hi,
    My smartform contains english as well as chinese words.
    Im tring to get PDF output from RSTXPDFT4 with spool request.Now  if I login in ZH or EN and use RSTXPDFT4  to generate o/p in PDF, its not working, PDF is generating blank page with error. This is a unicode systems.
    If my smarforms contailns only english then its OK.
    So what to do  please suggest.
    Regards,
    Kaushik
    Edited by: Matt on Mar 12, 2009 10:52 AM

    Moved to correct forum.  Please select the correct forum for your questions in future.

  • Problems with image on PDF output.

    In my report, I inserted an image (.jpg format) in the margin section. The background of the image is white. In Oracle Reports Builder, the image was just fine. However, when generating the PDF output, it seems like the image in  PDF was mixed with another color, or the background color has been changed. Why?
    Due to confidential information, I cannot provide the screenshot here.

    Appears to be a case of exceeding the original 100% w/h of the images.
    Generally the images should be 'prepped' in size (to match the quality when zoomed). So the starting size of the images/icons on the stage should be scaled smaller - then the zoom will factor to the original size. I hope that made some sense.
    Darrell

  • Facing problem in pdf output in obiee when handling pivot table

    i was making some changes in pivot table like adding columns in sections adding ..
    and many more changes which i dont remember i dont know what happend now i am not getting an pdf output.
    please let me know what can be the problem

    this happens when select option for 'place value in new row' in some columns and not in all

  • Report problem showing  characters(čžš) in pdf output

    nls teritory slovenian_slovenia
    bi publisher preferences
    UI Language =English     
    Report Locale =Slovenian(Slovenia)
    template rtf
    html output     
         ćčžćčžćčžćčžćčžćčžćčžćčćžčćžčžćčžćčĆŽČĆŽČŽĆČĆŽČŽĆČĆŽČĆŽČĆŽČĆ ( correct)
    pdf output
    ??????????????????????????????????????????????????????????????

    Hello,
    Your probably going to have to edit the xslt to get the result either by stripping out the comma or by setting that column to explicitly align the way you want it.
    Carl

  • PDF outputs continually crash after editing an html source file

    I have English and multiple localized versions of a RoboHelp webhelp project. I have created several PDF outputs for the localized versions. I can generate the PDFs fine when I don't touch any of the html source files.
    However, I had to make a change to one of the html source files to remove a <dl> from the source file. After making the change to the source file in an outside text editor (Notepad ++), I went back to RoboHelp to generate the PDF, and the PDF output crashed.
    The reason I was using an outside text editor is that when I tried to edit the <dl> HTML tags in RH, its HTML editor deleted all text within the tags being edited.  There was no undo at this point.  In anotehr attempt to use the RH Design editor, RH didn’t delete the <dd> or <dt> tags when those tag styles were changed to <h4> and <p>, respectively. RH inserted the new html wrapper inside the existing ones, instead of replacing it.
    Also, during the PDF generation process, a Visual Basic error message will appear dozens of times stating that the application was interrupted.  I must press OK to continue for each error message.
    What gives with the PDF generation failing like this?

    I hate to say it but it sounds like something you are doing in the external editor is not liked by RoboHelp.
    It could just be the way that text editor codes the file. I use EditPad Pro and that has various options for text encoding. My guess is your editor is not set to what RoboHelp expects.
    Aftr that what I would do here is create a new one topic project and recreate the problem, with the minimum of text. It may help you spot the code RoboHelp does not like.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

Maybe you are looking for

  • Hp external hard drive not recognised hp by pc

    I have had my HP PC for some time and had never completed a back up so purchased a HP external harddrive.  Part-way through the backup process (an hour or so later) the pc displayed a "backup failed" message. I have since attempted to connect the ext

  • FF Mac Desktop Addon and links download errors after upgrade to 35.0.1

    My problem started when FF was repeatedly trying to automatically upgrade to 35.0.1. It repeatedly failed the incremental upgrade and said I should download from Mozilla.org. However, after doing that and installing 35.0.1 both addons and application

  • Price for 2nd material to be copied from 1st material

    Hi Experts,       We have some unique requirement. My client is into service business. Most of our sales documents will be with one material for which price is determined from the condition records.   In few scenarios the cusotmer will also go for ad

  • Edit decision table from the web module

    Hello every one <br>I am using decision table to create rules and my question is can I edit decision table from the web module <br> i.e. can I change decision table values from jsp files(invoke.jsp) and if yes can any one please tell me the steps I s

  • SMTP NOT working but POP is OK

    My smtp account does not work and so it is unable to send emails. I have checked all the settings but no luck and my POP account works fine... Any help on this will be really appreciated...