{"id":25529,"date":"2019-04-02T20:11:08","date_gmt":"2019-04-02T18:11:08","guid":{"rendered":"http:\/\/help.qualiware.it\/qw-help\/?p=25529"},"modified":"2022-03-10T15:20:41","modified_gmt":"2022-03-10T14:20:41","slug":"inserimento-di-unimmagine-e-di-un-testo-in-un-file-pdf","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/inserimento-di-unimmagine-e-di-un-testo-in-un-file-pdf\/","title":{"rendered":"Inserimento di un&#8217;immagine e di un testo in un file PDF"},"content":{"rendered":"<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' Il seguente frammento di codice mostra come si pu\u00f2 inserire un'immagine e un testo in un file PDF\r\n' Pu\u00f2 essere usato in un form associato ad una categoria documentale di tipo file per apporre una firma e il nome\r\n' di chi ha firmato su un file PDF\r\n\r\ndim imgpath as string=Parameter1 ' Percorso dell'immagine, passato come parametro al metodo Execute di un oggetto Procedura\r\n\r\n' Appone la firma anche sul PDF!\r\n' vedere https:\/\/help.syncfusion.com\/file-formats\/pdf\/working-with-images\r\n\r\n' Recupera il percorso del documento PDF\r\ndim f as string=form.GetDocumentPath()\r\n\r\n'Load a PDF document.\r\nDim doc As New Syncfusion.Pdf.Parsing.PdfLoadedDocument(f)\r\n\r\n'Get first page from document\r\nDim page As Syncfusion.Pdf.PdfLoadedPage = TryCast(doc.Pages(0), Syncfusion.Pdf.PdfLoadedPage)\r\n\r\n'Create PDF graphics for the page\r\nDim graphics As Syncfusion.Pdf.Graphics.PdfGraphics = page.Graphics\r\n\r\n'Load the image from the disk\r\nDim image As New Syncfusion.Pdf.Graphics.PdfBitmap(imgpath)\r\n\r\n'Draw the image\r\ngraphics.DrawImage(image, 300,700,130,100) ' I parametri sono rispettivamente X,Y, width, height\r\n\r\n'Set the standard font.\r\nDim font As Syncfusion.Pdf.Graphics.PdfFont = New Syncfusion.Pdf.Graphics.PdfStandardFont(Syncfusion.Pdf.Graphics.PdfFontFamily.Helvetica, 15)\r\n\r\n'Draw the text.\r\ngraphics.DrawString(form.findcontrol(\"NOME\").Value, font, Syncfusion.Pdf.Graphics.PdfBrushes.Black, 300, 750)\r\n\r\n'Save the document.\r\ndoc.Save(f)\r\n\r\n'Close the document.\r\ndoc.Close(True)\r\n\r\nform.save()\r\n<\/pre>\n<p>E&#8217; possibile scaricare una categoria documentale d&#8217;esempio da <a href=\"https:\/\/help.qualiware.it\/qw-help\/wp-content\/uploads\/Firma-di-un-PDF-archiviato.zip\">qui<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &#8216; Il seguente frammento di codice mostra come si pu\u00f2 inserire un&#8217;immagine e un testo in un file PDF &#8216; Pu\u00f2 essere usato in un form associato ad una categoria documentale di tipo file per apporre una firma e il nome &#8216; di chi ha firmato su un file PDF dim imgpath as string=Parameter1&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[71],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25529"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=25529"}],"version-history":[{"count":0,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25529\/revisions"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=25529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=25529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=25529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}