Reading PDF data in SharePoint lists

I have an application in which clients fill out a PDF form and then publish it to the sharepoint library. After publishing the document, we want to discard the event handler in order to extract user data from the form and publish it to one or more match lists.

Any ideas on how I get started: I am new to PDFs, but understand the evolution of SharePoint well.

+3
source share
3 answers

Take a look at www.pdfsharepoint.com. Their product allows you to fill out Pdf forms and submit them to SharePoint. Fields can be mapped to SharePoint columns.

Dmitry

+3
source

, PDF, ( ).

, PDF Workflow Power Pack. ( , , ; -).

, , PDF-, InfoPath MS-Word . Word InfoPath SharePoint, , PDF, .

0

PDF, SharePoint. http _Layouts ".ashx".

In the PDF form, set the submit action to send the data in XML and specify its http handler URL.

Here is a sample handler code;

<%@ Assembly Name="Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ WebHandler Language="C#" Class="SP_PDFSubmitHandler" %>

using System;
using System.Web;
using Microsoft.SharePoint;
using System.Xml;

public class SP_PDFSubmitHandler : IHttpHandler {

    public void ProcessRequest (HttpContext context) {
        SPSite site = SPContext.Current.Site;
        SPWeb web = site.OpenWeb();

        try
        {
            string rawXML = "";
            XmlTextReader reader = new XmlTextReader(context.Request.InputStream);
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(reader);
            string _xmlString = xmlDoc.InnerXml;
            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            string _fileTime = DateTime.Now.ToFileTime().ToString();

            byte[] docAsBytes = encoding.GetBytes(_xmlString);

            //Insert Document 
        web.AllowUnsafeUpdates = true;

            SPList list = web.Lists["Purchase Order"];
            SPListItem item = list.Items.Add();

            item["Title"] = "PurchaseOrder_" + _fileTime + ".xml";
            item["Company Name"] = xmlDoc.GetElementsByTagName("txtOrderedByCompanyName").Item(0).InnerText;
            item["Date"] = xmlDoc.GetElementsByTagName("dtmDate").Item(0).InnerText;
            item["Order Total"] = xmlDoc.GetElementsByTagName("numGrandTotal").Item(0).InnerText;
            item.Attachments.Add("PurchaseOrder_" + _fileTime + ".xml", docAsBytes);
            item.Update();

        //Redirect the browser to the Purchase Order list so we can see our submisison.
        context.Response.Redirect("http://myserver/Lists/Purchase%20Order/AllItems.aspx");   

        }
        catch (Exception ex)
        {
            context.Response.Write(ex.Message);
        }


    }

    public bool IsReusable {
        get {
            return false;
        }
    }

}

Here is a great post describing the process http://blogs.adobe.com/mtg/2009/03/submitting-data-from-an-pdf-form-to-ms-sharepoint.html

Here is the MSDN post about Handlers https://msdn.microsoft.com/en-us/library/bb457204.aspx

0
source

Source: https://habr.com/ru/post/1727789/


All Articles