Problem with pdf export and setting of the paper size

Hi,
I develop plugins for InDesign server.
Can anybody suggest me an way to exports a pdf/ps file from a indesign document with my custom adjustment of the output "paper" size?
I tried with kPrintActionCmdBoss but the "SavePDFAs" popups although I set kSuppressEverything(!?)
When I used kPDFExportCmdBoss I cannot set paper size.
greetings

The helper class using IText:
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfImportedPage;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;
public class PDFHealer
   public static InputStream heal(InputStream in) throws DocumentException, IOException
      try
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         PdfReader reader = new PdfReader(in);
         // we retrieve the total number of pages
         int n = reader.getNumberOfPages();
         // step 1: creation of a document-object
         Document document = new Document();
         // step 2: we create a writer that listens to the document
         PdfWriter writer = PdfWriter.getInstance(document, out);
         // step 3: we open the document
         document.open();
         // step 4: we add content
         PdfContentByte cb = writer.getDirectContent();
         int i = 0;
         while( i < n )
            document.newPage();
            i++;
            PdfImportedPage page1 = writer.getImportedPage(reader, i);
            cb.addTemplate(page1, 0, 0);
         // step 5: we close the document
         document.close();
         ByteArrayInputStream ret = new ByteArrayInputStream(out.toByteArray());
         out.close();
         return ret;
      finally
         in.close();

Similar Messages

  • Problem with PDF export and embedded font (characters disappear)

    Designer: Crystal Reports 2008 SP 2
    Engine: CR4E 2.0 SP2 (runtime_12.2.203)
    Hi there!
    we found a problem in the pdf export. It seems like there would be a problem with the embedded fonts, the problem is as follows:
    Rpt file with, for example only a text box which contains the german string " Änderungs Schlüssel ".
    Export the Rpt file with CR4E to a pdf file.
    When we open the pdf file in Adope Reader 8, the text appears to be correct,
    but if we print the PDF file from the Adope Reader, the text changes to " nderungs Schl sselu201C,
    here we are missing ther german umlaute.
    When we open the file for example with an alternative PDF reader like Foxit Reader, there they are also missing.
    After i found some posts here in the forum, there are people facing the same problem, since i couldn't find a solution in the forum, we build a little workaround for it that works for us.
    For all of you that have the same problem here the workaround:
    We used the IText JAVA library, this jar can can help as to fix the PDF file so the text is displayed correctly.
    Here the code:
    ReportClientDocument doc = new ReportClientDocument();
    doc.setReportAppServer(ReportClientDocument.inprocConnectionString);
    doc.open("C:\XY.rpt", OpenReportOptions._openAsReadOnly);
    //... database logon,.....
    InputStream inputStream = doc.getPrintOutputController().export(ReportExportFormat.PDF);
    inputStream = PDFHealer.heal(inputStream);
    //... write the stream some where

    The helper class using IText:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.pdf.PdfContentByte;
    import com.lowagie.text.pdf.PdfImportedPage;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    public class PDFHealer
       public static InputStream heal(InputStream in) throws DocumentException, IOException
          try
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             PdfReader reader = new PdfReader(in);
             // we retrieve the total number of pages
             int n = reader.getNumberOfPages();
             // step 1: creation of a document-object
             Document document = new Document();
             // step 2: we create a writer that listens to the document
             PdfWriter writer = PdfWriter.getInstance(document, out);
             // step 3: we open the document
             document.open();
             // step 4: we add content
             PdfContentByte cb = writer.getDirectContent();
             int i = 0;
             while( i < n )
                document.newPage();
                i++;
                PdfImportedPage page1 = writer.getImportedPage(reader, i);
                cb.addTemplate(page1, 0, 0);
             // step 5: we close the document
             document.close();
             ByteArrayInputStream ret = new ByteArrayInputStream(out.toByteArray());
             out.close();
             return ret;
          finally
             in.close();

  • Indesign CS5 - Problems with PDF-Export

    Hello community,
    we do have a problem with Indesign CS5 and exporting data into PDF. It is about that logo on that white surface, which doesnt come along with the rest after the pdf-export. What we did was: We created that white surface in Indesign itself, put an effect on it with the Indesign effect gallery and then imported the logo in the surface ... the logo itself is .psd data. So, if we export it into pdf like that, it is just dissapeared. Does anyone have had a similar problem and what can be done about it?
    By the way ... if you put, for example, a simple backgroundshadow on a picture ... done also with the Indesign effect gallery, then you get just a white surface instead of the shadow, after the export into pdf. It does maybe correlate with the other problem ... not sure. Any suggestions?
    Thank you very much for your help and kind regards ...

    I would create the entire logo, including the white background, in Illustrator, save as PDF and place that in ID.

  • Why is my Mozilla Version 6.0.1 having problems with Bookmark Export and Import (html) ?

    I have used this feature numerous times with no problems. Starting yesterday, when I export html bookmark file, I get a delay - and then the html file is extraordinarily large (16,400 KB versus 782 KB normal file size).
    Also, when I attempt to import a saved html file, the new file will not save. Again, when I hit the "Export" or "Import"button, there is a prolonged delay.
    Should I delete Mozilla and reinstall ?

    Hi mrpetesix,
    Thanks for the insight. I seem to have solved the problem and can now sync iCal with my phone's calander as I used to without using iCloud. I am running the same setup as you (iTunes 11.0.1, osx 10.6.8, iOS 6.0.1) so, if you want, I'm sure you can do this too (although it seems you now hae found a good solution yourself). Anyway, here it is for the archives:
    When my phone was connected to iTunes, iTunes was showing that my Calander was being updated over the air by iCloud. It was not giving me any other options to choose which calanders to sync etc. So...
    On your iPhone, go to settings>>iCloud and turn calandars OFF.
    Now when you connect it to iTunes you can see all the old options under calandars and syncing between the two devices is back to 'normal'.
    I don't know when this iCloud setting got switched on my phone (I didn't even know it existed before this episode), probably when I updated iOS/iTunes recently.
    Hope that's useful to somebody. Cheers.

  • Problems with jpg export and color profiles

    I browsed the forum but I didn't find any recent thread about the issue I'm experiencing right now, I wonder if it's common or it just affects me. Mavericks, Aperture 3.5, all up-to-date.
    I imported a RAW file (I tried with both a Nikon and a Sony camera), made a few adjustements and then exported the picture as a jpg. It looked good in the Finder, in Photoshop, in Preview. When I uploaded the file to flickr, everything was ok.
    Then, I browsed flickr via its iOS app and - surprise - the image is completely wrong: colors are washed out, desaturated, with an awful greenish dominance. I tried a few things and discovered soon that also opening the file on my Mac with GraphicConverter has the same ugly result. Same with the iOS version of Safari.
    I use ProPhoto RGB as my default color space in Aperture. I changed to sRGB: same result. I changed to AbobeRGB and te output is finally consistent through all the platforms and apps.
    Too bad I managed to do this only for one photo because, even if I changed the settings, every other photo I exported is still sticking with ProPhoto RGB. The problem is surely here because I solved it changing manually the color space to AdobeRGB with Pixelmator and re-saving the images one by one. But of course this cannot be a successful workflow...
    Any experience about this?
    Thank you!

    OK, I can reply to myself. The issue has mysteriously gone away - no idea why. Edit: The issue is gone on Desktop, with GraphicConverter. From iOS, pictures still look weird.
    About the exported default, my bad: I was using presets and they choose their own settings for color space. Still, no idea why the first one was exported in Adobe RGB instead of ProPhoto RGB (the default for "JPEG - fit within 2048x2048").
    Message was edited by: difool

  • Problem with image scaling and aligning to the MC bounds

    HI
    I have problem with my custom class.
    For example if image is loaded into the
    holder_mc inside of
    loader_mc, and if the loaded image is bigger than the
    loader_mc, then I want it to scale it down to match
    loader_mc bounds.
    It is something similar to Loader class...
    I've copied this code outside of Loader.as file and modifyed
    it, but its not working...
    I'd realy appreciate that if you could find any mistake or
    any code similar to this...
    Thanks in advance and sorry for my bad english...
    mloncaric

    Anyone please?:(

  • Problem with fan, temperature and battery after the restore from the stop (Macbook pro 15)

    From a couple of weeks my macbook pro (15" 2.4 Ghz i7 4gb OS X 10.7.4) has this problem: when i close the screen it goes to stop and when i open it goes out the stop normaly but the fan and the temperature increase and the battery last nothing. So i reboot the mac and everithings go to normal way and also battery time increase in comparison with before...

    I've found that samsung kies wifi started at the login and that the app used 91% of my cpu and filled up my ram so i went to: system preference > users and groups > login's elements > and i deleted the app from the list.

  • Small problem with meta refresh and setting url

    I'm using the following line of code in my jsp.
    <meta http-equiv="refresh" content="<c:out value='${pageContext.session.maxInactiveInterval+60}'/>">This works fine in that 60 second after the session times out the refresh is called. This then goes into my action class and checks to see if my user object is still in session. It does not find it and forwards it to my login page with a message saying the session timed out.
    this works just fine
    Now instead of this happening I want to forward to an error page.
    so I can add a url into the content section of the tab... but when I try to use a
    <c:out value='${pageContext.request.contextPath}'/>this evaluates to nothing.. so that then the forward is to /sessionTimoutError.jsp instead of /appName/jsp/sessionTimeoutError.jsp.
    So my question is more of a verification. Is it true then that when the session times out it has absolutely nothing to do with struts and java.. and that when the refresh actually gets called and forwards it back to the logoff page that I've in effect created a new session that will timeout in 60 minutes and call a refresh in 61minutes?
    So the only way I can think of forwarding to the other page would be to change the forward in my action class... but changing this is not worth modifying all the action classes.. and I can't just change the definition of the forward since other places use that forward and I don't want to change them either...
    any othe ways anyone could think of doing this without hardcoding any url's in?

    Is it true then that when the session times out it has absolutely nothing to do with struts and java.Nothing to do with Struts, it's about JSP/servlet stuff specifically.
    <meta http-equiv="refresh" content="61; url=/timeout.html">that's the proper format, so you can dynamically write whatever URL you want.
    and that when the refresh actually gets called and forwards it back to the logoff pageOnly if the page that's reloaded checks for the valid login info and forwards. This is a common way to do it, of course.

  • Page size problem with pdf export

    I have a large text document created in Pages (about 300 pages). It's in A5 size (about 8x5). But when I export it to pdf, the page size switches to 8.5 x 11, screwing up the layout. Any ideas on what's going wrong in the export process? Thanks.

    The helper class using IText:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.pdf.PdfContentByte;
    import com.lowagie.text.pdf.PdfImportedPage;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    public class PDFHealer
       public static InputStream heal(InputStream in) throws DocumentException, IOException
          try
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             PdfReader reader = new PdfReader(in);
             // we retrieve the total number of pages
             int n = reader.getNumberOfPages();
             // step 1: creation of a document-object
             Document document = new Document();
             // step 2: we create a writer that listens to the document
             PdfWriter writer = PdfWriter.getInstance(document, out);
             // step 3: we open the document
             document.open();
             // step 4: we add content
             PdfContentByte cb = writer.getDirectContent();
             int i = 0;
             while( i < n )
                document.newPage();
                i++;
                PdfImportedPage page1 = writer.getImportedPage(reader, i);
                cb.addTemplate(page1, 0, 0);
             // step 5: we close the document
             document.close();
             ByteArrayInputStream ret = new ByteArrayInputStream(out.toByteArray());
             out.close();
             return ret;
          finally
             in.close();

  • Problems with pdf-export / Probleme beim PDF-Export

    Hi,
    I tried to export a pdf from the "report" as portrait. It came out as a landscape. The left side of the pdf showing my exported report (as portrait), the right half of the page empty...
    Not exactly what I meant to do!
    Wenn ich ein pdf im Hochformat aus "Report" exportiere, erhalte ich ein PDF im Querformat. Auf der rechten Seite ist mein exportierter Report (im Hochformat), die linke Hälfte der Seite ist leer.
    Kann mir jemand weiterhelfen?

    Moritz -
    Did you mean to post this question in the "Feedback" board?  I would be happy to move it for you to the appropriate product board, but I'm not exactly sure which language you are programming in.  Can you let me know where you intended for this to go?
    Thanks,
    Molly K.
    Web Support & Operations Manager
    National Instruments

  • Fonts problems with PDF reports and Lexmark printers

    Hi,
    since yesterday we use Oracle Reports Services 10.1.2.3.0 as our productive reports services.
    When we print PDF reports on one of the following printers, the fonts size isn't correct (in the report defined as font size 8, on the paper the font size is about 16!).
    - Lexmark T620 PS3
    - Lexmark W820 PS3
    The printers work correct if I print out a PDF file via Adobe Acrobat Reader.
    Best regards
    Flo

    Hi,
    I'm afraid that this was a couple of years ago so I can't remember the font we used.
    If memory serves then I think it is something to do with True Type fonts.
    Have you searched Metalink? I think that's where I originally got some advice about the fonts in PDF documents.

  • CS4 exporting and reduction of the file size

    Hello,
    I'm new to the Premiere pro. I'm trying to export the movie, which as a final product will be uploaded on the Web for the employees to download it on their computers.
    It is a similar situation as TreeHugger98 posted on: http://forums.adobe.com/message/2004696
    I had 3 WMV recordings of a Microsoft Live Meeting event - a conference call, with a bunch of PowerPoint slides and the audio of the presentation/discussion. Each about 25MB and 2 fps, 704 x 528, 16000 Hz - 16 bit, Mono. 
    I have selected the settings for the project: (I'm in US) 720 x 480, 29.97 fps, 32000Hz, stereo, and scaled to the size.
    I combined a few bits and pieces in one, so the final movie is 2 hrs long. I need to have a reasonable size output, so the file has to be downloadable, however no matter what settings I tried - the size is enormous, not to mention the rendering time. It doesn't have to be saved for both platforms - apart from designers, all employee have PC, so do I.
    Could anyone help?
    Thanks in advance

    robodog2,
    Thank you for answering - sometime I feel that all you guys are being bored with getting one question over and over, but I assure you your answers are being highly appreciating by newcomers such I myself.
    I'm new to the Premiere pro. I'm trying to export the movie,  which as a final product will be uploaded on the Web for the employees  to download it on their computers.
    You just need to put a file up on the web, not a "playing " movie ?  So they download the file ? - YES, this is what I meant, (however I tried to publish the mpg4, just to see what I would get).
    I  had 3 WMV recordings of a Microsoft Live Meeting event - a conference  call, with a bunch of PowerPoint slides and the audio of the  presentation/discussion. Each about 25MB and 2 fps, 704 x 528, 16000 Hz -  16 bit, Mono.
    this isnt very specific...like how many bytes did you start out with to begin with for each source ( asset ). wmv is very compressed and it really isnt perfect for "editing" as it is a "delivery" format...for viewing, not editing...
    Regardless, if you export that to anything that isnt really compressed it will probably be a larger "byte count" than you started with, because wmv is very compressed to begin with... know what I mean ???
    2 hours of avi type 2 SD ( standard definition 720x480 ) is roughly 26 GIGABYTES in byte count....
    These are the details of the files I started out with: exactly the size were: 20MB, 25MB and 24MB, all of them 2 fps, 704 x 528, 16000 Hz -  16 bit, Mono.  I have read about the compression, but this is very valuable information: what file type would be perfect for editing then?
    I have selected the settings  for the project: (I'm in US) 720 x 480, 29.97 fps, 32000Hz, stereo, and  scaled to the size.
    without knowing what you had to begin with who knows what this project setting did...but basically you must match your assets specs with the project settings....
    Which are what, in this example...? I went trough all the available settings and I couldn't decided which would be the best. I was only sure, that it had to be NTSC aspect ratio 4:3.
    I combined a few bits  and pieces in one, so the final movie is 2 hrs long. I need to have a  reasonable size output, so the file has to be downloadable, however no  matter what settings I tried - the size is enormous, not to mention the  rendering time. It doesn't have to be saved for both platforms - apart  from designers, all employee have PC, so do I.
    "no matter what settings I tried " doesnt tell me anything really...I have no idea what you tried ....please be more specific about this....and what the parameters of your final product have to be...in other words, can you downsize the product a little bit ? Make it smaller than 720x480 ?
    What do the people who get this have to do with it ?? Just look at it ?  So maybe it doesn't have to be 720x480....making it smaller on the export side would make the byte count smaller and still be OK to view on a computer.
    I have tried .mov,. mpg4 and back to .wmv again. I can go smaller than 780x480, unfortunately because of the compression the video is not very good quality to start with. The solution would be to use original presentation, save each slide separately an import to the project. Do you recommend doing that?
    Thank you,

  • Can only print with manual feed and NOT from the paper tray from websites

    When I try to print something from a website, I must manually feed the paper in the manual feed slot. It will not print from the tray. This problem does not happen when I print something from an email with no downloads or something from MSword or Excel. So, it's most likely a browser printer setting issue. Any ideas?
    Thanks

    Probably related to printer preferences and how they relate to Firefox. If you did the complete reset all the printer setting that Firefox would saved would have been cleared and gone back to the default settings. Without familiarity with that specific printer ''(or even knowing which printer you are using)'' the best advice I can offer is to seek help from a support forum for that brand printer, or for you to reinstall the printer software to get back to the defaults.

  • Big problem with PDF export from CS4

    Create a document with facing pages. Then place a rectangle or any other object on the master through the whole spread. Place the text or any other object on the master over the first rectangle on the both pages. Now, when exporting pdf, the text on the left pages is disappeared becaouse it covered by the copy of the rectangle. The variation of the problem is when using any tansparencies, then they become "less transparent" on the left pages because of this strange dublicating.
    There is an archive in attachment that contains indd and pdf files with this problem.

    Thanks, it works, but bug is still bug. In some cases it's impossible to do this, for example my recent case: it was text with huge outer glow on master pages. Outer glow from right page dublicates to the left and covered left text, and there's no way to move effect to another layer separately. The solution was to detach these texts from masters, but it's also unhandy solution.
    It's hard to detect such cases unless it happen with big elements.

  • Problem with PDF export in CC

    When exporting to pdf in Photoshop CC in CMYK, Acrobat opens it with a blank page and the message that it's out of memory. Exporting the same file as RGB opens fine. Any ideas? Exporting as CMYK has worked fine in all the previous versions of Photoshop and still does in CS6.

    This is still a problem unfortunately: http://forums.adobe.com/thread/1265266

Maybe you are looking for