Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7889603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:08:29+00:00 2026-06-03T06:08:29+00:00

I want to create a WCF service (working like windows service). This service will

  • 0

I want to create a WCF service (working like windows service). This service will read a PDF file from a specific path, extract pages, create a new PDF file and return it to the caller.

How can I do this ? I use QuickPDF to process on PDF files, I can extract and create new PDF file. How can use this in a WCF service ?

Waiting your helps…

This is only sample code :

public Stream ExtractPdf(string PathOfOriginalPdfFile, int StartPage,int PageCount)
{
        PDFLibrary qp = new PDFLibrary();
        Stream Stream_ = null;

        if (qp.UnlockKey(".................") == 0)
        {
            string fileName = @"..\..\Test Files\sample1.pdf";
            string OutputFile = @"..\..\Test Files\sample1_extracted.pdf";

            if (qp.Unlocked() == 1)
            {

                int docID = qp.LoadFromFile(fileName, "");

                int extractPageSuccess = qp.ExtractPages(StartPage, PageCount);

                if (extractPageSuccess == 0)
                {
                    // error
                }
                else
                {
                    qp.SaveToFile(OutputFile);
                }
            }
        }

        //
        // Codes here
        //
        return Stream_;
    }

I edited it :

 public byte[] ExtractPdf(string PathOfOriginalPdfFile, int StartPage,int PageCount)
    {

        QuickPDFDLL0815.PDFLibrary qp = new QuickPDFDLL0815.PDFLibrary(@"C:\Program Files (x86)\Quick PDF Library\DLL\QuickPDFDLL0815.dll");

        string fileName = @"..\..\Test Files\sample1.pdf";
        byte[] binFile = null;

        if (qp.UnlockKey("...................") == 0)
        {


            if (qp.Unlocked() == 1)
            {

                int docID = qp.LoadFromFile(fileName, "");

                int extractPageSuccess = qp.ExtractPages(StartPage, PageCount);

                if (extractPageSuccess == 0)
                {
                    // error
                }
                else
                {
                   binFile = qp.SaveToString();
                }
            }
        }

        return binFile;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:08:30+00:00Added an answer on June 3, 2026 at 6:08 am

    You could send the file as a Stream, see How to: Enable Streaming, then on the client save off the file and have the shell execute it. The MSDN article includes a sample GetStream method as well as a whole section on Writing a custom stream.

    If you would like fuller sample code the forum post Streamed file transfer using WCF starts with some, however, note that the author posted it there because they were encountering issues running it.

    As to byte[] or stream see Uploading Image Blobs–Stream vs Byte Array and Stream vs Raw Bytes. The second states

    Streams will perform better for large files since not all of it needs to be read into memory at one time

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create new WCF service and client. The 2 parties will communicate
I want to create a new WCF service and client. The 2 parties will
I want to create a DispatchMessageInspector for my WCF service that will run before
At work, I want to create a WCF Windows Service that runs on a
I want to create WCF service and client. I want to add 2 way
Hi I want to create a WCF service that have login method, which is
I have a WCF Service Using MSMQ hosted on IIS. I want to create
I have created one WCF service , which is working fine, now i want
I want to create a WCF service that accepts an XML message that interoperates
I have a solution file ( i.e DLL file). i want to create webservice/WCF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.