Re: pdf
I may do just that... on one of my own web sites. (I have a site devoted to source code for many languages, but the uptake has been a little slower than I anticipated). You can see that site at www.sourcecodecorner.com (the article isn't there yet, not sure when I can get the article up). If you have ideas for articles, I would be happy to see them.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: Adobe Acrobat
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "Adobe Acrobat"
Collapse
-
Guest replied
-
Guest repliedpdf
that's a 'nice to know', fanpilot. well done. perhaps you could post a small article?
Leave a comment:
-
Guest repliedRe: pdf
I have found a way to do it, doesn't need as much as that C#, any activex or anything. In fact the way to do it is so easy that it is beyond belief.
PDF has a form definition format. The file type is FDF. Create the FDF (which can easily be done in ASP) and then stream this to the browser. The browser understands what FDF is, and will open Acrobat Reader, which will then open the associated PDF.
Piece of cake once you know what FDF is, and the FDF format is easy as well.
The PDF though will need form fields that are populated by the FDF. We wasn't doing anything special, but we did need to fill out a form from a web form.
Leave a comment:
-
Guest repliedpdf
you say you want to interface with Acrobat 'somehow' ?
how ?
unless there is an api written specially for the job - like the office apps - then you can't.
The above code is more similar to writing out chunks of rtf (for word) than it is to operating it remotely, or somewhere in between.
If you do enquire then let me know if Adobe do actually supply a proper interface like word/excel/etc so that it could be remotely executed.
Check www.developa.com/cvdotnet.htm for a dotNET 'applet/ActiveX' control that operates Word on the client from the web. You will have to have .NET installed client side and you will also have to drop your security settings in mscorcfg.msc to witness it.
Regards
Steve.
Leave a comment:
-
Guest repliedPDF Generator
I can send you an actual pdf generator written in C#, aw hell it's pasted below.
It's a bit cumbersome from the look of it but once you have a template sorted then replacing text with stuff from a db or web form would be simple.
Getting that template looking nice is the hard bit.
And you have to learn .NET and host on .NET server for it to work. But it will produce on the fly pdf and save to hdd.
using System;
using System.IO;
using System.Text;
using System.Collections;
namespace PDFGenerator
{
        /// <summary>
        /// Application : Generation of PDF file from text
        /// Author                : Pramod Kumar Singh
        /// Date                : 25th July 2001
        ///</summary>
               
        public class PDFGenerator
        {
                static float pageWidth = 594.0f;
                static float pageDepth = 828.0f;
                static float pageMargin = 30.0f;
                static float fontSize = 10.0f;
                static float leadSize = 10.0f;
               
                //Create a PDF file.
                //PDF on Disk
                static StreamWriter pPDF=new StreamWriter("E:\ \Downloads\\_unzip2\\myPDF.pdf");
                //PDF in Memory
                static MemoryStream mPDF= new MemoryStream();
               
                //Convert the Text Data to PDF format and write back to
                //Memory Stream
                static void ConvertToByteAndAddtoStream(string strMsg)
                {
                        Byte[] buffer=null;
                        buffer=ASCIIEncoding.ASCII.GetBytes(strMsg);
                        mPDF.Write(buffer,0,buffer.Length);
                        buffer=null;
                }
               
                //Format the data length in xRef Format
                static string xRefFormatting(long xValue)
                {
                        string strMsg =xValue.ToString();
                        int iLen=strMsg.Length;
                        if (iLen<10)
                        {
                                StringBuilder s=new StringBuilder();
                                //string s=null;
                                int i=10-iLen;
                                s.Append('0',i);
                                strMsg=s.ToString() + strMsg;
                        }
                        return strMsg;
                }
                //Entry Point
                static void Main(string[] args)
                {
                        //Create a ArrayList for xRefs of PDF Document
                        ArrayList xRefs=new ArrayList();
                        Byte[] buffer=null;
                        float yPos =0f;
                        long streamStart=0;
                        long streamEnd=0;
                        long streamLen =0;
                        string strPDFMessage=null;
                        //PDF Header Message
                        strPDFMessage="%PDF-1.1\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                       
                        //ID 1 For Containt
                        //ID 2 For Length of the Stream
                        //write the Text
                       
                        //1> Start a new Page
                        xRefs.Add(mPDF.Length);
                        strPDFMessage="1 0 obj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage="<< /Length 2 0 R >>\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage="stream\n";
ConvertToByteAndAddtoStream(strPDFMessage);
                       
                        //Get the start of the stream
                        streamStart=mPDF.Length;
                        strPDFMessage="BT\n/F0 " + fontSize +" Tf\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        yPos = pageDepth - pageMargin;
                        strPDFMessage=pageMargin + " " + yPos +" Td\n" ;
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage= leadSize+" TL\n" ;
                        ConvertToByteAndAddtoStream(strPDFMessage);
                       
                        //Add the text data to the PDF memory stream
                        strPDFMessage= "(Pramod Kumar Singh)Tj\n" ;
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage= "ET\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        //Get the End of the stream
                        streamEnd=mPDF.Length;
                        //Get the Length of the stream
                        streamLen=streamEnd-streamStart;
                        strPDFMessage= "endstream\nendobj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                                       
                        //Add 2 object to xRef
                        xRefs.Add(mPDF.Length);
                        strPDFMessage="2 0 obj\n"+ streamLen + "\nendobj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                                               
                        //Add Page to xRefs
                        xRefs.Add(mPDF.Length);
                        strPDFMessage="3 0 obj\n<</Type/Page/Parent 4 0 R/Contents 1 0 R>>\nendobj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                       
                        //Build the Pages
                        xRefs.Add(mPDF.Length);
                        strPDFMessage="4 0 obj\n<</Type /Pages /Count 1\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage="/Kids[\n3 0 R\n]\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage="/Resources<</ProcSet[/PDF/Text]/Font<</F0 5 0 R>> >>\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        strPDFMessage="/MediaBox [ 0 0 "+ pageWidth + " " + pageDepth + " ]\n>>\nendobj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                       
                        //Add font to xRefs
                        xRefs.Add(mPDF.Length);
                        strPDFMessage="5 0 obj\n<</Type/Font/Subtype/Type1/BaseFont/Courier/Encoding/WinAnsiEncoding>>\nendobj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                                       
                        //Add the catalog to xRefs
                        xRefs.Add(mPDF.Length);
                        strPDFMessage="6 0 obj\n<</Type/Catalog/Pages 4 0 R>>\nendobj\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                                               
                        //xRefs Entry
                        streamStart=mPDF.Length;
                        strPDFMessage="xref\n0 7\n0000000000 65535 f \n";
                        for(int i=0;i<xRefs.Count;i++)
                        {
                                strPDFMessage+=xRefFormatting((long) xRefs<!--EZCODE ITALIC START--> )+" 00000 n \n";
                        }
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        //Trailer for the PDF
                        strPDFMessage="trailer\n<<\n/Size "+ (xRefs.Count+1)+"\n/Root 6 0 R\n>>\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        //xRef location entry
                        strPDFMessage="startxref\n" + streamStart+"\n%%EOF\n";
                        ConvertToByteAndAddtoStream(strPDFMessage);
                        //Write the PDF from Memory Stream to File Stream
                        mPDF.WriteTo(pPDF.BaseStream);
                        //Close the Stream
                        mPDF.Close();
                        pPDF.Close();
                }
        }
}<!--EZCODE ITALIC END-->
Leave a comment:
-
Guest repliedwww.fineprint.com have a product called pdfFactory (about US$30) which will write pdf docs for you. Much cheaper than full Acrobat Writer.
Gordon
Leave a comment:
-
Guest repliedYes.
Leave a comment:
-
Guest replied(that will Adobe Acrobat v5, right?)
Leave a comment:
-
Guest started a topic Adobe AcrobatAdobe Acrobat
I have just been shown some wonderful stuff with Acrobat that I never gave it much credit for.
Now, if possible, I need to be able to "generate" pdf on the fly from a web page.
I have seen with acrobat, that you can have form fields and these can be easily populated from a text file.
Now, what I need to do is to have a html form on a web site, which interfaces somehow to acrobat (into a pre-prepared document) then shows the viewer that pdf document with the contents of the form filled in.
Do I just install acrobat on the web server or do I need another product?
I will be using ASP to interface to acrobat.Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Leave a comment: