Help with PDF creation using CFDOCUMENT / iText

Hi everyone,
Finally made the jump to CF7 after sticking with 5 for way
too long and now have an urgent need to generate PDF.
<cfdocument> seems to do better than anything else at
converting HTML styled with CSS, but falls short in a few
fundamental areas. What I need to do ( to name 3) is:
* Generate a table of contents - including page numbers
* Have far greater control over the headers / footers
* Swap page orientation mid-document
I can get round the page orientation thing by creating each
section as an individual PDF and gluing them back together using
PaulH's excellent PDF concatenation code. Using <cfdocument>
I can reserve space for the headers / footers, and add a table of
contents with placeholders for the numbers.
Now, my question: Will I be able to rewrite all the page
numbers, finish off the table of contents and headers / footers
using iText? i.e. traverse the concatenated PDF file, rewrite the
headers / footers, work out the page numbers and rewrite the TOC?
I'm not asking for sample code or even a how to - just a
heads-up from some who knows iText well and can quickly say whether
this is feasible.
I hope it is because my alternative approach is to go down
the xsl-fo route which I suspect will be more effort in the long
run.
Thanks
PJ

as alternative solution you might check activepdf products.
www.activepdf.com
cheers
kim

Similar Messages

  • PDF created using Java iText package - Text not editable and not displaying font properties on Acrobat

    Hi,
    I have an issue in editing the text and viewing the font properties of a text region on a PDF created using Java iText package.
    I use Adobe Acrobat 9 Pro Extended and the option Tools -> Advanced Editing -> TouchUp Text Tool.
    The strange behaviour is that, I have 2 PDFs created out of the same base PDF and text added via Java iText package with the same Text, Font and other properties.
    One of the PDF has the text region editable on Acrobat but the other one has the text region which is not editable.
    But both the PDFs are editable via Adobe Illustrator.
    I have attached both the PDFs for your reference
    PDF_Editable.pdf - Editable on Acrobat
    PDF_Not Editable.pdf - Not Editable on Acrobat
    Any help or insight to find out the difference/issue with the PDF which is not editable via Acrobat would be appreciated.
    Thanks in advance.
    Regards,
    Madhusoodhan Henryraman

    You don't have direct control of the leading of a multiline text field. A common approach is to control the background color of the field with JavaScript since the lines are not really needed when the field is used in Reader/Acrobat. They may be useful when using the form by hand. For more information, see the posts by Max in this topic: http://acrobatusers.com/forum/forms-acrobat/how-do-i-use-multi-lined-text-fields-over-prin ted-line-area-existing-form

  • Help with pdf tasks

    Hello,
    I am trying to automate a couple of specific tasks with pdf files but I am having some trouble. At my job we are printing files to pdf but afterwards we must go back and edit the pdf files. Basically what we need to do is this (in order):
    1) Rotate the first 'one to three' pages. The first page(s) need to be rotated counterclockwise but it can be 1-3 pages that need this. All we know is that they always appear first. These pages are very similiar in content so I was thinking about making the program search for a keyword common to those pages then rotate it if it finds that keyword. That way we can ensure that its only rotating the pages which need to be rotated.
    2) The last 3 pages of the document need to be moved to the top. These documents vary in number of pages so I cant just tell the program to move certain pages numbers to the top. All we know is that its always the last 3 pages of any document that need to be moved to the top. Also, just for clarification is another way to reorder pages in Acrobat besides dragging them with the mouse?
    Any input would be greatly appreciated.
    Thanks
    Fazal

    Both of these could be implemented using JavaScript, perhaps using a batch sequence. #2 is easy, and #1 may or may not be possible/reliable based on the actual content of the document.
    For #1, a script is able to loop through the words on a page to search for one or more words. If found, it can look at the position of the word on the page, and if it meets the position criteria, use the setPageRotations document method to rotate the page.
    For #2, just use the movePage document method to move the last three pages.
    If you need help with the code, consider posting in the Acrobat Scripting forum. Include more information for #1 if you do.

  • Help with PDF Generation

    We are currently evaluating LiveCycle ES to potentially convert numerous Pro/E 3D drawings to PDF. Unfortunately, I am having a difficult time finding the proper resources to help achieve this. What we would like the process to do is:
    1) Take a Pro/E file, and apply a forms template
    2) Add an "Exploded View" animation for the 3D drawing (such as what can be generated by Adobe 3D Reviewer)
    3) Expose the "Bill of Material" to the template fields
    4) Save the generated PDF to a defined folder
    5) Perform these steps for a "watched folder" for when new drawings are submitted
    In LiveCycle Workbench, I have been able to read a Pro/E file and apply our template. But I cannot find information on how to achieve the other steps.
    Could somebody please point me to specific resources and/or samples that would help with this? Any help would be very appreciated.
    Thanks!

    Thanks for your reply.
    If I'm understanding you correctly, option 1 probably won't work for this situation, because we're working with existing ProE drawings -- hundreds, if not thousands, of them. So, they don't want to go back and add the exploded view. Unless you're saying that we could use javaScript to generate the exploded view and BOM from the ProE files?
    Do you know of an example (or other resource) that describes either of the options you outlined? Could you explain a little more?
    Thanks again!

  • Help with PDF Javascript calculation involving checkboxes

    Hello Everyone,
    I have a PDF Form, and need help with a calculation.
    For the sake of simplicity, Lets say I have 5 fields. FSA1 and FSA2 are checkboxes. TotalClaimed1 and TotalClaimed2 are text fields which allow only a numerical input.
    The last box, FSA_Total, should add the value from TotalClaimed1 if FSA1 is checked, and it should also add the value from TotalClaimed2 if FSA2 is checked.
    The code is malfunctioning, however. Something is causing it to add to the total every time the box is checked. Its almost like the checking off of the box is what causes the addition.
    It seems like the code is being read as "When the box is checked, add the value to the total", so each time the box gets checked, it adds to the total again.
    and it should be "IF the box is checked, add the value to the total" so if there is a value in the field, and the box is checked, that value is passed on to the total; and if the box is not checked, the value is ignored.
    Can anyone spot what might be causing this? Code is below.
    var claim1 = parseInt(this.getField('TotalClaimed1').value),
        claim2 = parseInt(this.getField('TotalClaimed2').value),
        fsabox = parseInt(this.getField('FSA_Total').value);
    if (this.getField('FSA1').value == 'Yes') {
        fsabox += claim1;
    if (this.getField('FSA2').value == 'Yes') {
        fsabox += claim2;
    event.value = fsabox;
    Thanks
    Thisguy1234

    This is a custom calculation script for FSA_Total, correct? The code is working correctly, it's just not what you want. Assuming this is a custom calculation script in the FSA_Total field, it should be something like:
    var sum = 0;
    var claim1 = parseInt(getField('TotalClaimed1').value, 10),
        claim2 = parseInt(getField('TotalClaimed2').value, 10),
    // Add field values if corresponding check boxes are selected
    if (getField('FSA1').value !== "Off") {
        sum += claim1;
    if (getField('FSA2').value !== "Off") {
        sum += claim2;
    // Set this field value
    event.value = sum;
    Why are you using parseInt, exactly?

  • Help with PDF settings in InDesign for Newspaper print

    Hi I work for a newspaper and until recently we have done the newspaper layout in Pagemaker. We finally changed to InDesign. I am now at the point where I have to export to PDF. What would be the best to use, export as PDF or printing to postscript? I'm not exactly sure what PDF setting to use if I do export it? With Pagemaker I used to print to a
    Postscript printer

    I suggest you ask the person that will recieve your file, what suits him or her best.
    If it's a PDF exported from InDesign, you could even ask for a definition file to import (see screen shot for the menu item to select), so that you don't need to make all settings yourself, but get them correct from the start.
    Best regards
    Andreas

  • HELP WITH PDF TO WORD DOC

    pLEASE HELP WITH CONVERTING A PDF REPORT TO A WORD DOC WHERE i CAN MAKE CHANGES AND PRINT A NEW REPORT.

    Hi Christine,
    It looks like you have a subscription to our ExportPDF service. Follow the steps in our Getting Started Guide to convert your PDF to Word: http://forums.adobe.com/docs/DOC-2412
    You should be able to edit your file in Word after the conversion.
    -David

  • Help with Photo Gallery using XML file

    I am creating a photo gallery using Spry.  I used the Photo Gallery Demo (Photo Gallery Version 2) on the labs.adobe.com website.  I was successful in creating my site, and having the layout I want.  However I would like to display a caption with each photo that is in the large view.
    As this example uses XML, I updated my file to look like this:
    <photos id="images">
                <photo path="aff2010_01.jpg" width="263" height="350" thumbpath="aff2010_01.jpg" thumbwidth="56"
                   thumbheight="75" pcaption="CaptionHere01"></photo>
                <photo path="aff2010_02.jpg" width="350" height="263" thumbpath="aff2010_02.jpg" thumbwidth="75"
                   thumbheight="56" pcaption="CaptionHere02"></photo>
                <photo path="aff2010_03.jpg" width="350" height="263" thumbpath="aff2010_03.jpg" thumbwidth="75"
                   thumbheight="56" pcaption="CaptionHere03"></photo>
    </photos>
    The images when read into the main file (index.asp) show the images in the thumbnail area and display the correct image in the picture pain.  Since I added the pcaption field to the XML file, how do I get it to display?  The code in my index.html file looks like this:

    rest of the code here:
            <div id="previews">
                <div id="controls">
                    <ul id="transport">
                        <li><a href="#" class="previousBtn" title="Previous">Previous</a></li>
                        <li><a href="#" class="playBtn" title="Play/Pause" id="playLabel"><span class="playLabel">Play</span><span class="pauseLabel">Pause</span></a></li>
                        <li><a href="#" class="nextBtn" title="Next">Next</a></li>
                    </ul>
                </div>
                <div id="thumbnails" spry:region="dsPhotos" class="SpryHiddenRegion">
                    <div class="thumbnail" spry:repeat="dsPhotos"><a href="{path}"><img alt="" src="{thumbpath}"/></a><br /></div>
                    <p class="ClearAll"></p>
                </div>
            </div>
            <div id="picture">
                <div id="mainImageOutline"><img id="mainImage" alt="main image" src=""/><br /> Caption:  {pcaption}</div>
            </div>
            <p class="clear"></p>
        </div>
    Any help with getting the caption to display would be greatly appreciated.  The Caption {pcaption} does not work,

  • Need help with PDF/X-1a

    I am beyond frustrated here so I hope someone can help me!!!! Ii have Adobe 8 Standard and I can't find the PDF/X-1a in my distiller. I need this particular preset to upload a book cover. The website won't accept any other format. The only thing I have in my distiller is PDF/A-1b.
    Does anyone know where I can get the correct distiller? Everyone I know with Adobe 8 has the PDF/X-1a in their options and they don't remember having to do anything special to get it.

    Assuming you have Acrobat installed, it would not hurt to verify compliance after the document is created. With the doc open (on my vesion 9) Advanced > Print Production > Preflight > PDF/X Compliance > Verify compliance with PDF/X-1a  hit analyze
    Note that a document must have a Title in the Title box under Document > Properties (ctrl+d) to pass X-1a and, for whatever reason, analyze and fix cannot add this.
    And I'm far from the resident expert here..

  • Help with Switch statements using Enums?

    Hello, i need help with writing switch statements involving enums. Researched a lot but still cant find desired answer so going to ask here. Ok i'll cut story short.
    Im writing a calculator program. The main problem is writing code for controlling the engine of calculator which sequences of sum actions.
    I have enum class on itself. Atm i think thats ok. I have another class - the engine which does the work.
    I planned to have a switch statement which takes in parameter of a string n. This string n is received from the user interface when users press a button say; "1 + 2 = " which each time n should be "1", "+", "2" and "=" respectively.
    My algorithm would be as follows checking if its a operator(+) a case carry out adding etc.. each case producing its own task. ( I know i can do it with many simple if..else but that is bad programming technique hence im not going down that route) So here the problem arises - i cant get the switch to successfully complete its task... How about look at my code to understand it better.
    I have posted below all the relevant code i got so far, not including the swing codes because they are not needed here...
    ValidOperators v;
    public Calculator_Engine(ValidOperators v){
              stack = new Stack(20);
              //The creation of the stack...
              this.v = v;          
    public void main_Engine(String n){
           ValidOperators v = ValidOperators.numbers;
                    *vo = vo.valueOf(n);*
         switch(v){
         case Add: add();  break;
         case Sub: sub(); break;
         case Mul: Mul(); break;
         case Div: Div(); break;
         case Eq:sum = stack.sPop(); System.out.println("Sum= " + sum);
         default: double number = Integer.parseInt(n);
                       numberPressed(number);
                       break;
                      //default meaning its number so pass it to a method to do a job
    public enum ValidOperators {
         Add("+"), Sub("-"), Mul("X"), Div("/"),
         Eq("="), Numbers("?"); }
         Notes*
    It gives out error: "No enum const class ValidOperators.+" when i press button +.
    It has nothing to do with listeners as it highlighted the error is coming from the line:switch(v){
    I think i know where the problem is.. the line "vo = vo.valueOf(n);"
    This line gets the string and store the enum as that value instead of Add, Sub etc... So how would i solve the problem?
    But.. I dont know how to fix it. ANy help would be good
    Need more info please ask!
    Thanks in advance.

    demo:
    import java.util.*;
    public class EnumExample {
        enum E {
            STAR("*"), HASH("#");
            private String symbol;
            private static Map<String, E> map = new HashMap<String, E>();
            static {
                put(STAR);
                put(HASH);
            public String getSymbol() {
                return symbol;
            private E(String symbol) {
                this.symbol = symbol;
            private static void put(E e) {
                map.put(e.getSymbol(), e);
            public static E parse(String symbol) {
                return map.get(symbol);
        public static void main(String[] args) {
            System.out.println(E.valueOf("STAR")); //succeeds
            System.out.println(E.parse("*")); //succeeds
            System.out.println(E.parse("STAR")); //fails: null
            System.out.println(E.valueOf("*")); //fails: IllegalArgumentException
    }

  • Help with swap images using rollovers

    I have a website created using DW CS5. Recently purchased FW CS5 to help with web graphics and design. I am trying to create a list of numbers that will swap with images. The intial page would simply be a list of numbers and 1 static image. Each number, when hovered will change the image with another. I've attempted this by first using DW and not having much success with FW either.
    If able to complete this using FW, is it possible to export the file for use in DW? Then insert into an AP Div?

    You're over-complicating it.
    Simply hit File>Save once you're done in photoshop.
    ian

  • Need Help With Military DTD Using FrameMaker 8

    Fellow Forum Members,
    I hope someone out there with experience in using Department of Defense DTDs with FrameMaker can contribute to this thread.
    Attached is the MIL STD 400051-2 DTD that needs to play with FrameMaker. Does anyone out there know where I could find FrameMaker templates already setup that comply and play with the MIL STD 400051-2 DTD standard? If the Department of Defense is freely distributing the MIL STD 400051-2 DTD, shouldn't somebody in the Department of Defense also be providing MIL STD 400051-2 FrameMaker Templates for free that are already setup?  I would greatly appreciate if anyone out there could provide an online source where I could download MIL STD 400051-2 FrameMaker templates.
    Lastly, can anyone out there clarify what the purpose of the entities are inside the "Charant" and "Boilerplate" folders?  The Department of Defense does not provide a readme file that define what the "Charant" and "Boilerplate" folders are about.
    Any info will be greatly appreciated. Thanks.

    I'll answer the specifics that I know about your questions, but please look at the post from Srini for additional info:
    1) Do i need to do full export using SYS/SYSTEM user.
    exp80 system/manager file=c:full.dmp log=c:\full.txt full=y consistent=yA full export will move as much information (metadata/data) as possible. In order to do a full export/import, you need to do this from a
    privileged account. A privileged account is one with EXP_FULL_DATABASE for export and IMP_FULL_DATABASE for import.
    2) Will there be any data corruption while export.The data in the objects that you are exporting is being read, nothing is written to user data. I'm not sure what this is available in 8.0.6,
    but if you need a consistent export, look to see if consistent=y is available in 8.0.6. All this means is that the dump file created will have
    consistent data in it.
    3) Is export/import the only method of migration/upgradation.If you are changing hardware, the only supported way from 8.0 to 10.2.0.4, that I know of, is using exp/imp.
    Hope this helps.
    Dean

  • Issue with generating large pdf file using cfdocument tags in CF9

    We are in the process of upgrading our code to use cf9 and the cfdocument tag (from the old cfx_pdf tags).  We have successfully gotten one piece of our code to work but the file size of the pdf that we are generating now is huge in comparison to what it was using the CFX_PDF tags. (I.E.  with the new code the file is 885 KB in comparison to the old code generating only a 11KB file). We are not embedding fonts so the Fontembed = "no" didn't work for us.  We do have all of our images as .jpgs but unfortunately due to the volume of images that we have we can not switch all these files into another format.  Is there is way to shrink or optimize the pdf file size that we are generating? 
    Thanks so much for your help.
    Claudia

    We are in the process of upgrading our code to use cf9 and the cfdocument tag (from the old cfx_pdf tags).  We have successfully gotten one piece of our code to work but the file size of the pdf that we are generating now is huge in comparison to what it was using the CFX_PDF tags. (I.E.  with the new code the file is 885 KB in comparison to the old code generating only a 11KB file). We are not embedding fonts so the Fontembed = "no" didn't work for us.  We do have all of our images as .jpgs but unfortunately due to the volume of images that we have we can not switch all these files into another format.  Is there is way to shrink or optimize the pdf file size that we are generating? 
    Thanks so much for your help.
    Claudia

  • Help with Program creation that deletes deliveries by using VL02

    Hi,
    Can anyone guide me on creating a program based on the following requirement:
    Select-Options: Sales Org, Distribution Channel, Customer
    Read data from KNVV where Sales Org = <input from selection screen>
    Based on the data read, find the said documents with delivery type LO in table LIKP.
    For each document found, delete the documents by processing VL02 (background)
    How can I create this? <b>Are any BAPI's available to do this?</b>
    Here is the code that i have so far:
    TABLES: KNVV.
    DATA: I_KNVV LIKE KNVV OCCURS 0 WITH HEADER LINE,
          I_LIKP LIKE LIKP OCCURS 0 WITH HEADER LINE.
    SELECT-OPTIONS: S_VKORG FOR KNVV-VKORG,
                    S_VTWEG FOR KNVV-VTWEG,
                    S_KUNNR FOR KNVV-KUNNR.
    SELECT * INTO TABLE I_KNVV FROM KNVV
    WHERE VKORG IN S_VKORG AND
          VTWEG IN S_VTWEG AND
          KUNNR IN S_KUNNR.
    SELECT * INTO TABLE I_LIKP FROM LIKP
    FOR ALL ENTRIES IN I_KNVV
    WHERE VKORG = I_KNVV-VKORG
    AND LFART = 'LO'.
    All Detailed answers will be rewarded and greatly appreciated.
    Thanks,
    John

    I wrote simple program and test it ur system..
    I have tested in 4.6C Version.
    REPORT ZVBPA_MOD.
    TABLES: KNVV.
    data : bdcdata like bdcdata occurs 0 with header line.
    DATA: I_KNVV LIKE KNVV OCCURS 0 WITH HEADER LINE,
    I_LIKP LIKE LIKP OCCURS 0 WITH HEADER LINE.
    SELECT-OPTIONS: S_VKORG FOR KNVV-VKORG,
    S_VTWEG FOR KNVV-VTWEG,
    S_KUNNR FOR KNVV-KUNNR.
    start-of-selection.
    SELECT * INTO TABLE I_KNVV FROM KNVV
    WHERE VKORG IN S_VKORG AND
    VTWEG IN S_VTWEG AND
    KUNNR IN S_KUNNR.
    SELECT * INTO TABLE I_LIKP FROM LIKP
    FOR ALL ENTRIES IN I_KNVV
    WHERE VKORG = I_KNVV-VKORG
    AND KUNNR = I_KNVV-KUNNR
    AND LFART = 'LO'.
    loop at I_LIKP.
    perform bdc_dynpro      using 'SAPMV50A' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LIKP-VBELN'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LIKP-VBELN'
                                  I_LIKP-vbeln.
    perform bdc_dynpro      using 'SAPMV50A' '0200'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/ELOES'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LIKP-VBELN'.
    call transaction 'VL02' using bdcdata
                               mode 'N'
                               update 'S'.
    ENDLOOP.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
    ENDFORM.

  • Creating PDF's using cfdocument hangs the server

    We are running two ColdFusion 9 servers on Suse linux 11.3, 64 bit.  We are current on all our hot fixes.
    Over time (a couple of days usually) all of our PDF reports hang.  No exceptions are thrown.  Eventually they timeout.  A server reboot is required to fix the problem.  The rest of the app functions fine.
    Once this condition occures, all of the PDF reports hang (some reports have a lot of data....some have minimal).  If the <cfdocument> tag is empty, the report will execute normally, but even just "hello world" in the cfdocument tag hangs.  I am guessing that there is some system resource that it is waiting for--a thread, memory, etc.  But the rest of the app runs fine, so it appears to be something specific to <cfdocument>.  We are currently configured with 3G jvm, 360 jvm threads.
    These same reports have been running for a couple of years on cf8 and cf9 (with no hotfixes).  We deployed a new app on cf9 (with hotfixes) about a month ago which is when the problem started.
    We are not sure what else to try....server reboots are getting old.  Any comments would be appreciated.

    The best thing you can do in this situation is to examine the server during the failure condition. You do this by generating a stack trace. There are several ways to generate a stack trace from running commands on your Linux server to using features of the ColdFusion Admin API. Here are some links to get your started.
    Generating a snapshot/stack trace via code using the CF Admin API.
    http://awe.st/fX6HEy
    PDF of presentation notes and stack trace options from Charlie Arehart.
    http://awe.st/eVvgpw
    Once you've generated the stack trace you need to look through it for issues with memory (JVM heap), CPU, locked threads etc. Reading stack traces is not the easiest thing to do, especially making decisions on what to do based on what you see. In other words, it'd be hard to cover everything in a forum post. But, this sort of analysis should help you figure out more about what is happening during the failure condition.

Maybe you are looking for

  • Doubt in loop

    Hi Gurus........... i have my code below ...problem is that when it goes for the first time if get the value but when it goes again in to the loop , first loop is getting exected the second and the third loop returns sy-subrc 4 thou it has value.....

  • ListView jiggles horizontally when large item about to scroll in or out in Windows Phone 8.1 Preview

    If you have a ListView (in a Windows Phone 8.1 Store app, running on the developer preview 8.10.123979.895) in which you do not explicitly constrain the size of your list view's item template (e.g., because you'd like it to resize automatically when

  • Select characters/symbols won't display on iPod 160GB Classic since restore

    I don't know if anyone has come across this yet or not. My new iPod 160GB Classic crashed after 1 week. Since restoring, I've noticed that certain characters/symbols won't display in artist/title names on my iPod that used to display just fine before

  • File-Bapi-Idoc scenario

    Hi Experts, I am working on the scenario like File-Bapi-Idoc 1) Getting the file from external system, in the file If the Sonumber is populated then need trigger an Bapi_change and after getting the response flag as 1 from Bapi then have to send all

  • How to find the partition column in a partitioned table

    Hi, I have a partition table and I need to find out what column was used to partition the table. Range partition. Thanks, Maria Sanchez