Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: load internal path of ressource (.dll) Pin
Garth J Lancaster16-Dec-14 11:32
professionalGarth J Lancaster16-Dec-14 11:32 
Questionconvert any string to 24 hexadecimal digits Pin
Jassim Rahma16-Dec-14 8:40
Jassim Rahma16-Dec-14 8:40 
AnswerRe: convert any string to 24 hexadecimal digits Pin
Richard MacCutchan16-Dec-14 8:59
mveRichard MacCutchan16-Dec-14 8:59 
AnswerRe: convert any string to 24 hexadecimal digits Pin
Kornfeld Eliyahu Peter16-Dec-14 9:55
professionalKornfeld Eliyahu Peter16-Dec-14 9:55 
GeneralRe: convert any string to 24 hexadecimal digits Pin
PIEBALDconsult16-Dec-14 10:21
mvePIEBALDconsult16-Dec-14 10:21 
GeneralRe: convert any string to 24 hexadecimal digits Pin
Jassim Rahma16-Dec-14 10:45
Jassim Rahma16-Dec-14 10:45 
GeneralRe: convert any string to 24 hexadecimal digits Pin
PIEBALDconsult16-Dec-14 11:20
mvePIEBALDconsult16-Dec-14 11:20 
Questionremove handwriting from pdf (not in list of objects) Pin
Ali Hakak16-Dec-14 5:02
Ali Hakak16-Dec-14 5:02 
I need to remove a handwriting signature from the pdf using itextsharp.

this handwriting signature can not be selected by mouse, i can access all the object buy this hand writing signature is not in the list of objects or signatures. how can i remove it?

here is part of my code to replace one of images. I need to replace image and signature.

public void ReplaceImage()
{
string pdfFilePath = Server.MapPath(".") + "/PDFFiles/Receipt.pdf";
string imageURL = Server.MapPath("/PdfImagesFiles") + "/img3.jpg";
string OutputFilePath = Server.MapPath("/PDFFiles/result.pdf");

PdfReader pdf = new PdfReader(pdfFilePath);
PdfStamper stp = new PdfStamper(pdf, new FileStream(OutputFilePath, FileMode.Create));

PdfWriter writer = stp.Writer;
var reader = new PdfReader(pdfFilePath);
var pdfContentByte = stp.GetOverContent(1);
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(imageURL);
PdfDictionary pg = pdf.GetPageN(1);
PdfDictionary res = (PdfDictionary)PdfReader.GetPdfObject(pg.Get(PdfName.RESOURCES));
PdfDictionary xobj = (PdfDictionary)PdfReader.GetPdfObject(res.Get(PdfName.XOBJECT));
Document doc = new Document();

if (xobj != null)
{
foreach (PdfName name in xobj.Keys)
{
PdfObject obj = xobj.Get(name);

if (obj.IsIndirect())
{
PdfDictionary tg = (PdfDictionary)PdfReader.GetPdfObject(obj);
PdfName type = (PdfName)PdfReader.GetPdfObject(tg.Get(PdfName.SUBTYPE));

if (PdfName.IMAGE.Equals(type))
{
PdfReader.KillIndirect(obj);//remove the object
writer.AddDirectImageSimple(img, (PRIndirectReference)obj);//add new image

}
}
}

}

stp.Close();
}
A.Hakak

AnswerRe: remove handwriting from pdf (not in list of objects) Pin
Dave Kreskowiak16-Dec-14 6:00
mveDave Kreskowiak16-Dec-14 6:00 
QuestionMake the routing network safe Pin
Member 1101334015-Dec-14 9:44
Member 1101334015-Dec-14 9:44 
AnswerRe: Make the routing network safe Pin
Eddy Vluggen16-Dec-14 0:28
professionalEddy Vluggen16-Dec-14 0:28 
Questiontool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
Member 1041097215-Dec-14 0:34
Member 1041097215-Dec-14 0:34 
AnswerRe: tool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
OriginalGriff15-Dec-14 1:02
mveOriginalGriff15-Dec-14 1:02 
AnswerRe: tool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
Simon_Whale15-Dec-14 1:02
Simon_Whale15-Dec-14 1:02 
AnswerRe: tool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
Eddy Vluggen15-Dec-14 3:02
professionalEddy Vluggen15-Dec-14 3:02 
GeneralRe: tool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
Member 1041097215-Dec-14 5:35
Member 1041097215-Dec-14 5:35 
AnswerRe: tool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
BillWoodruff15-Dec-14 3:15
professionalBillWoodruff15-Dec-14 3:15 
GeneralRe: tool.Strip1.Visible = false and toolStrip2.Visible = false? Pin
Member 1041097215-Dec-14 5:43
Member 1041097215-Dec-14 5:43 
QuestionHow to store GPS Device data in the SQL data base Pin
heyvid14-Dec-14 18:05
heyvid14-Dec-14 18:05 
AnswerRe: How to store GPS Device data in the SQL data base Pin
syed shanu14-Dec-14 20:50
professionalsyed shanu14-Dec-14 20:50 
AnswerRe: How to store GPS Device data in the SQL data base Pin
Eddy Vluggen14-Dec-14 22:32
professionalEddy Vluggen14-Dec-14 22:32 
GeneralMind Your Language Pin
heyvid15-Dec-14 1:56
heyvid15-Dec-14 1:56 
GeneralRe: Mind Your Language Pin
Eddy Vluggen15-Dec-14 3:00
professionalEddy Vluggen15-Dec-14 3:00 
AnswerRe: How to store GPS Device data in the SQL data base Pin
Simon_Whale14-Dec-14 23:46
Simon_Whale14-Dec-14 23:46 
QuestionMessage Removed Pin
14-Dec-14 5:38
owais201214-Dec-14 5:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.