<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="poppler-poppler-attachment">
<refmeta>
<refentrytitle role="top_of_page" id="poppler-poppler-attachment.top_of_page">PopplerAttachment</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>POPPLER Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>PopplerAttachment</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="poppler-poppler-attachment.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="PopplerAttachment"/>
<synopsis>
                    <link linkend="PopplerAttachment-struct">PopplerAttachment</link>;
<link linkend="gboolean">gboolean</link>            <link linkend="poppler-attachment-save">poppler_attachment_save</link>             (<link linkend="PopplerAttachment">PopplerAttachment</link> *attachment,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="poppler-attachment-save-to-callback">poppler_attachment_save_to_callback</link> (<link linkend="PopplerAttachment">PopplerAttachment</link> *attachment,
                                                         <link linkend="PopplerAttachmentSaveFunc">PopplerAttachmentSaveFunc</link> save_func,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            (<link linkend="PopplerAttachmentSaveFunc">*PopplerAttachmentSaveFunc</link>)        (const <link linkend="gchar">gchar</link> *buf,
                                                         <link linkend="gsize">gsize</link> count,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GError">GError</link> **error);
</synopsis>
</refsynopsisdiv>









<refsect1 id="poppler-poppler-attachment.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="poppler-poppler-attachment.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="PopplerAttachment-struct" role="struct">
<title>PopplerAttachment</title>
<indexterm zone="PopplerAttachment-struct"><primary sortas="PopplerAttachment">PopplerAttachment</primary></indexterm><programlisting>typedef struct _PopplerAttachment PopplerAttachment;</programlisting>
<para>
</para></refsect2>
<refsect2 id="poppler-attachment-save" role="function">
<title>poppler_attachment_save ()</title>
<indexterm zone="poppler-attachment-save"><primary sortas="poppler_attachment_save">poppler_attachment_save</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            poppler_attachment_save             (<link linkend="PopplerAttachment">PopplerAttachment</link> *attachment,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Saves <parameter>attachment</parameter> to a file indicated by <parameter>filename</parameter>.  If <parameter>error</parameter> is set, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
will be returned. Possible errors include those in the <link linkend="G-FILE-ERROR--CAPS"><type>G_FILE_ERROR</type></link> domain
and whatever the save function generates.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>attachment</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="PopplerAttachment"><type>PopplerAttachment</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> name of file to save
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, if the file successfully saved
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="poppler-attachment-save-to-callback" role="function">
<title>poppler_attachment_save_to_callback ()</title>
<indexterm zone="poppler-attachment-save-to-callback"><primary sortas="poppler_attachment_save_to_callback">poppler_attachment_save_to_callback</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            poppler_attachment_save_to_callback (<link linkend="PopplerAttachment">PopplerAttachment</link> *attachment,
                                                         <link linkend="PopplerAttachmentSaveFunc">PopplerAttachmentSaveFunc</link> save_func,
                                                         <link linkend="gpointer">gpointer</link> user_data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Saves <parameter>attachment</parameter> by feeding the produced data to <parameter>save_func</parameter>. Can be used
when you want to store the attachment to something other than a file, such as
an in-memory buffer or a socket. If <parameter>error</parameter> is set, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> will be
returned. Possible errors include those in the <link linkend="G-FILE-ERROR--CAPS"><type>G_FILE_ERROR</type></link> domain and
whatever the save function generates.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>attachment</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="PopplerAttachment"><type>PopplerAttachment</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>save_func</parameter>&#160;:</term>
<listitem><simpara> a function that is called to save each block of data that the save routine generates.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> user data to pass to the save function.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> return location for error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, if the save successfully completed
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="PopplerAttachmentSaveFunc" role="function">
<title>PopplerAttachmentSaveFunc ()</title>
<indexterm zone="PopplerAttachmentSaveFunc"><primary sortas="PopplerAttachmentSaveFunc">PopplerAttachmentSaveFunc</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            (*PopplerAttachmentSaveFunc)        (const <link linkend="gchar">gchar</link> *buf,
                                                         <link linkend="gsize">gsize</link> count,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Specifies the type of the function passed to
<link linkend="poppler-attachment-save-to-callback"><function>poppler_attachment_save_to_callback()</function></link>.  It is called once for each block of
bytes that is "written" by <link linkend="poppler-attachment-save-to-callback"><function>poppler_attachment_save_to_callback()</function></link>.  If
successful it should return <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>.  If an error occurs it should set
<parameter>error</parameter> and return <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, in which case <link linkend="poppler-attachment-save-to-callback"><function>poppler_attachment_save_to_callback()</function></link>
will fail with the same error.
</para><variablelist role="params">
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara>buffer containing bytes to be written.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara>number of bytes in <parameter>buf</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>A location to return an error.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>user data passed to <link linkend="poppler-attachment-save-to-callback"><function>poppler_attachment_save_to_callback()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>%TRUE if successful, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> (with <parameter>error</parameter> set) if failed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
