Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change a Button Icon of a PDF Formular with itextsharp?
    primarykey
    data
    text
    <p>I'am currently trying to fill out a predefined Form with itextsharp. All works well except adding an image. This worked already before with the FDF toolkit from Adobe, which was compiled into .NET 1.1. This isn't working with .NET 4.0 anymore and I switched to itextsharp. The way the image was added previously was by changing the icon of a button in a predefined form. That rotateted and scaled the image correctly. Unfortunatly I couldn't find any Method to do this with itextsharp. The code was:</p> <pre><code>FdfAcX_Doc.FDFSetAP("img", 0, "path\\to\\img.pdf", 1); </code></pre> <p>(Doc: <a href="http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FDFtkRef.pdf" rel="nofollow">http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FDFtkRef.pdf</a>)</p> <p>Now I was experimenting with itextsharp and trying to add the image manually, e.g.:</p> <pre><code>PdfContentByte pdfContentByte = pdfStamper.GetOverContent(1); iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(picfile); iTextSharp.text.Rectangle imageRect = new iTextSharp.text.Rectangle(338f, 65f, 250f, 200f, 270); img.ScaleToFit(imageRect.Width, imageRect.Height); img.SetAbsolutePosition(65, 250); pdfContentByte.AddImage(img); </code></pre> <p>But unfortunatly firstly the image is not rotated corretly and secondly the image is way too big. I tried several settings but couldn't hit the correct one. Does anyone have an idea what I'm doing wrong?</p> <p>PDF Form can be downloaded here: <a href="http://www26.zippyshare.com/v/24914063/file.html" rel="nofollow">http://www26.zippyshare.com/v/24914063/file.html</a></p> <p>Please help, I've been sitting at this problem for a day now and can't think of anything more. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload