Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everybody,

I am creating one web application, within that i am getting HTML Code from Database which contains
    and <img> tags with inline styles.when i create the PDF using iTextSharp from that string, the text overlay on images but the same html works fine in browser.

    How to solve this issue?

    Can anybody help me?

    my HTML is
    ========================================================
    XML
    <html>
        <body>
            <span style="color:#005AA0;font-family:Arial,Helvetica,sans-serif;font-size: 15px !important;font-weight: bold;margin-bottom: 5px;margin-top: 5px;text-transform: uppercase;">Add Image on About Us</span>
            <br/>
            <br/>
            <br/>
            <span style="font-family:Arial,Helvetica,sans-serif;font-size: 15px;" >On About Us:</span>
            <ol style="font-family:Arial,Helvetica,sans-serif;font-size: 15px;line-height:40px;">
                <li> Select &apos;Add Image Block&apos;. <img src="http://localhost:2107/Images/HelpImages/AddImageBlock.jpg"></li>
                <li> Click &apos;Add/Edit Image&apos;. <img src="http://localhost:2107/Images/HelpImages/AddEditImage.jpg"></li>
                <li> If the image is in your image gallery click on the image (not the check box) and go to step 9.</li>
                <li> To add an image to the gallery from your computer, click &apos;Browse&apos;. <br/>
                    <img src="http://localhost:2107/Images/HelpImages/imgBrowse.jpg"></li>
                <li> Double click on the image file that you would like to upload.  Note: You may only upload images that are jpeg, jpg, gif or png.</li>
                <li> Enter a name for the image.</li>
                <li> Select &apos;Upload&apos;.</li>
                <li> Your image will now appear in the Image Editor.  Click on the image (not the check box).</li>
                <li> The system will automatically resize your image to fit the width of the image block.</li>
                <li> To adjust the image height, go to the bottom of the image until you see the grabbers.  Pull the grabber with your mouse up or down until your image is adjusted properly.<br/>
                    <img src="http://localhost:2107/Images/HelpImages/imgResize.jpg" width="109px" height="165px"></li>
                <li> Note: The system will not allow you to make the image wider than the image block.</li>
                <li> Choose the alignment of your image by selecting from the drop down box in step 3.<br/> <img src="http://localhost:2107/Images/HelpImages/ChooseAlign.jpg"></li>
                <li> To hyperlink your image, see &apos;Create Link to Image&apos; in the Help Menu.</li>
                <li> When finished select the &apos;Insert&apos; button in Step 5. <img src="http://localhost:2107/Images/HelpImages/Insert.jpg"></li>
                <li> Your image will now appear in the image block on About Us.</li>
            </ol>
        </body>
    </html>


    ========================================================
Posted

1 solution

To work with PDF, use iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900