Изменить номера страниц в EvoPDF

В pdf можно изменить нумерацию страниц, чтобы первой страницей была страница 5 и т. д.

(Это не имеет ничего общего с верхними и нижними колонтитулами, я говорю строго о номерах страниц, которые отображаются на панели инструментов PDF)

Можно ли управлять этими номерами с помощью EvoPDF?


person mendel    schedule 04.09.2014    source источник


Ответы (2)


Да, видимо, с EVOPDF v5 вы можете установить номер, который будет отображаться на странице, используя свойство PageNumberingStartIndex в PdfHeaderOptions (то же самое для нижних колонтитулов). Я не знаю ни одного примера использования этого.

person Glen Little    schedule 28.01.2015

Невозможно изменить нумерацию страниц, отображаемую Adobe Reader, с помощью параметра в сгенерированном документе PDF. Что вы можете сделать, так это заставить средство просмотра PDF перейти на определенную страницу в документе PDF при открытии документа. Вы можете проверить Переход к месту на странице PDF при открытии документа Демо< /а> . Код C# для реализации этой функции:

protected void convertToPdfButton_Click(object sender, EventArgs e)
{
    // Create a HTML to PDF converter object with default settings
    HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

    // Set license key received after purchase to use the converter in licensed mode
    // Leave it not set to use the converter in demo mode
    htmlToPdfConverter.LicenseKey = "4W9+bn19bn5ue2B+bn1/YH98YHd3d3c=";

    Document pdfDocument = null;
    try
    {
        // Convert a HTML page to a PDF document object
        pdfDocument = htmlToPdfConverter.ConvertUrlToPdfDocumentObject(urlTextBox.Text);

        int goToPageNumber = int.Parse(pageNumberTextBox.Text);
        if (goToPageNumber > pdfDocument.Pages.Count)
        {
            return;
        }

        // Get destination PDF page
        PdfPage goToPage = pdfDocument.Pages[goToPageNumber - 1];

        // Get the destination point in PDF page
        float goToX = float.Parse(xLocationTextBox.Text);
        float goToY = float.Parse(yLocationTextBox.Text);

        PointF goToLocation = new PointF(goToX, goToY);

        // Get the destination view mode
        DestinationViewMode viewMode = SelectedViewMode();

        // Create the destination in PDF document
        ExplicitDestination goToDestination = new ExplicitDestination(goToPage, goToLocation, viewMode);

        // Set the zoom level when the destination is displayed
        if (viewMode == DestinationViewMode.XYZ)
            goToDestination.ZoomPercentage = int.Parse(zoomLevelTextBox.Text);

        // Set the document Go To open action
        pdfDocument.OpenAction.Action = new PdfActionGoTo(goToDestination);

        // Save the PDF document in a memory buffer
        byte[] outPdfBuffer = pdfDocument.Save();

        // Send the PDF as response to browser

        // Set response content type
        Response.AddHeader("Content-Type", "application/pdf");

        // Instruct the browser to open the PDF file as an attachment or inline
        Response.AddHeader("Content-Disposition", String.Format("attachment; filename=Go_To_Page_Open_Action.pdf; size={0}", outPdfBuffer.Length.ToString()));

        // Write the PDF document buffer to HTTP response
        Response.BinaryWrite(outPdfBuffer);

        // End the HTTP response and stop the current page processing
        Response.End();
    }
    finally
    {
        // Close the PDF document
        if (pdfDocument != null)
            pdfDocument.Close();
    }
}
person EvoPdf    schedule 08.09.2014
comment
спасибо за ваш ответ, я думаю, что я хочу в настоящее время невозможно. (Я не знаю, заслуживает ли это «принятого ответа»?) - person mendel; 08.09.2014
comment
Что такое тип «Ответа»? - person Karthik AMR; 09.09.2015