<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>adobe c# &#8211; ASP.NET Hosting Reviews and Guides</title>
	<atom:link href="https://topreviewhostingasp.net/tag/adobe-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://topreviewhostingasp.net</link>
	<description>ASP.NET Hosting &#124; Reviews &#124; Tips &#38; Tutorial</description>
	<lastBuildDate>Mon, 22 Jul 2024 04:50:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://topreviewhostingasp.net/wp-content/uploads/2017/01/cropped-trhaico-32x32.png</url>
	<title>adobe c# &#8211; ASP.NET Hosting Reviews and Guides</title>
	<link>https://topreviewhostingasp.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Add Attachments to Adobe Using C#</title>
		<link>https://topreviewhostingasp.net/how-to-add-attachments-to-adobe-using-c/</link>
					<comments>https://topreviewhostingasp.net/how-to-add-attachments-to-adobe-using-c/#respond</comments>
		
		<dc:creator><![CDATA[Jacques Hunt]]></dc:creator>
		<pubDate>Mon, 22 Jul 2024 04:11:52 +0000</pubDate>
				<category><![CDATA[Hosting Tips]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[adobe c#]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[asp net core]]></category>
		<category><![CDATA[asp net core tips]]></category>
		<guid isPermaLink="false">https://topreviewhostingasp.net/?p=3867</guid>

					<description><![CDATA[PDF/A-3 supports the embedding of any file type into PDF documents. This enables the transition from electronic paper to an electronic container that stores both the human and machine-readable versions of a document. Applications can extract the machine-readable portion of a PDF document and process it. A PDF/A-3 document can include an unlimited number of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>PDF/A-3 supports the embedding of any file type into PDF documents. This enables the transition from electronic paper to an electronic container that stores both the human and machine-readable versions of a document. Applications can extract the machine-readable portion of a PDF document and process it. A PDF/A-3 document can include an unlimited number of embedded documents for various processes.</p>
<p>This article will teach you how to embed a plain text file in a PDF document and how to extract the attachment from it.</p>
<h2 id="adding-attachments" data-nav="true">Adding Attachments</h2>
<p>This sample code demonstrates how TX Text Control can be used to attach a text file to a PDF document.</p>
<pre>        // create a non-UI ServerTextControl instance
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {

  tx.Create();
  // set dummy content
  tx.Text = "PDF Document Content";

  // read the content of the attachment
  string sAttachment = System.IO.File.ReadAllText("attachment.txt");

  // create the attachement
  TXTextControl.EmbeddedFile attachment =
     new TXTextControl.EmbeddedFile(
        "attachment.txt",
        sAttachment,
        null) {
       Description = "My Text File",
       Relationship = "Unspecified",
       MIMEType = "application/txt",
       CreationDate = DateTime.Now,
     };

  // attached the embedded file
  tx.DocumentSettings.EmbeddedFiles =
     new TXTextControl.EmbeddedFile[] { attachment };

  // save as PDF/A
  tx.Save("document.pdf", TXTextControl.StreamType.AdobePDFA);
}</pre>
<p>The attached file is represented by the EmbeddedFile object. The constructor accepts the file name, data, and additional meta data. In addition, the MIME type of the attachment (application/text in this case), a textual description, a relationship, and the creation date are provided.</p>
<p>The relationship is an optional string that describes the relationship between the embedded file and the containing document. It can be a predefined value or adhere to the rules for second-class names (ISO 32000-1, Annex E). Predefined values include <strong>&#8220;Source&#8221;</strong>, <strong>&#8220;Data&#8221;</strong>, <strong>&#8220;Alternative&#8221;</strong>, <strong>&#8220;Supplement&#8221;</strong>, and <strong>&#8220;Unspecified&#8221;</strong>.</p>
<p>When you open the document in Adobe Acrobat Reader, the attachment will appear in the Attachments side panel.</p>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-3868 aligncenter" src="https://topreviewhostingasp.net/wp-content/uploads/2024/07/attachment.webp" alt="" width="988" height="724" srcset="https://topreviewhostingasp.net/wp-content/uploads/2024/07/attachment.webp 988w, https://topreviewhostingasp.net/wp-content/uploads/2024/07/attachment-300x220.webp 300w, https://topreviewhostingasp.net/wp-content/uploads/2024/07/attachment-768x563.webp 768w, https://topreviewhostingasp.net/wp-content/uploads/2024/07/attachment-50x37.webp 50w" sizes="(max-width: 988px) 100vw, 988px" /></p>
<h2 id="extracting-attachments" data-nav="true">Extracting Attachments</h2>
<p>The code below loads the created PDF file in order to locate the attachment by looping through all embedded files. The found attachment is extracted and saved as a text file.</p>
<pre>// create a non-UI ServerTextControl instance
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {

  tx.Create();

  // load the PDF document
  TXTextControl.LoadSettings ls = new TXTextControl.LoadSettings();
  tx.Load("document.pdf", TXTextControl.StreamType.AdobePDF, ls);

  // read the attachments
  TXTextControl.EmbeddedFile[] files = ls.EmbeddedFiles;

  // find the specific attachment and save it
  foreach(TXTextControl.EmbeddedFile file in files) {
    if (file.Description == "My Text File") {
      string sAttachment = Encoding.UTF8.GetString((byte[])file.Data);
      System.IO.File.WriteAllText("attachment_read.txt", sAttachment);

      break;
    }
  }
}</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://topreviewhostingasp.net/how-to-add-attachments-to-adobe-using-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
