1
PDF 스티커 메모의 아이콘을 확대하려고합니다. 여기에 내가 컨텍스트의 PDF의 첫 페이지에 스탬프 한 끈적 끈적한 아이콘을 표시하는 이미지입니다 : 내가 인상했다iTextSharp를 통해 배치 된 PDF 스티커 메모의 아이콘 크기는 어떻게 변경합니까?
아이콘을 조작 할 수있는 사각형으로 안내했다.
using (PdfStamper stamp = new PdfStamper(reader, fs))
{
PdfWriter attachment = stamp.Writer;
foreach (string file in files_to_attach)
{
PdfFileSpecification pdfAttch = PdfFileSpecification.FileEmbedded(attachment, file, file, null);
stamp.AddFileAttachment(file, pdfAttch);
}
//Create Note for first page
Rectangle rect = new Rectangle(850, 850, 650, 650);
PdfAnnotation annotation = PdfAnnotation.CreateText(stamp.Writer, rect, "TITLE OF NOTE", "Body text of the note", false, "Comment");
//Enlarge the Sticky Note icon
PdfDictionary page = reader.GetPageN(1);
PdfArray annots = page.GetAsArray(PdfName.ANNOTS);
PdfDictionary sticky = annots.GetAsDict(0);
PdfArray stickyRect = sticky.GetAsArray(PdfName.RECT);
PdfRectangle stickyRectangle = new PdfRectangle(
stickyRect.GetAsNumber(0).FloatValue - 50, stickyRect.GetAsNumber(1).FloatValue - 20,
stickyRect.GetAsNumber(2).FloatValue, stickyRect.GetAsNumber(3).FloatValue - 30);
sticky.Put(PdfName.RECT, stickyRectangle);
//Apply the Note to the first page
stamp.AddAnnotation(annotation, 1);
stamp.Close();
}
는 내가 플로트 값을 변경할 수 있다고 생각하고 그 아이콘의 모양을 변경 것이지만, 지금까지이 모두 영향을하지 않은 : 여기에 아직 효과가되지 않은 내 코드입니다. 어떤 제안이있어 주셔서 감사합니다.
"최종 사용자와 같은 방식으로 기능"을 갖기 위해서는 여전히 주석으로 표시해야합니다. 오른쪽 : PdfAnnotation annotation = PdfAnnotation.CreateText (stamp. Writer, rect, "TITLE OF NOTE", "본문 본문", false, "Comment"), "댓글"대신 이미지를 전달합니다. "설명"은 문자열이며, 이미지를 문자열로 만들 수있는 구문은 무엇입니까? – DBlair
Bruno의 AddStamp 예제를 참조하십시오. 자바지만 아이디어를 얻을 수 있습니다. http://developers.itextpdf.com/examples/actions-and-annotations/clone-creating-and-adding-annotations#2260-addstamp.java – joelgeraci