We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Determine magnification in PDF files using Aspose.PDF

Support Team,

Using ASPOSE.pdf (latest version 18.6) we set the magnificaiton as below.

pdfDocument.OpenAction = null;
if (IsBookmarkAvailable && pdfDocument.PageMode != Aspose.Pdf.PageMode.UseOutlines)
{
pdfDocument.PageMode = Aspose.Pdf.PageMode.UseOutlines;
}
else if (!IsBookmarkAvailable && pdfDocument.PageMode != Aspose.Pdf.PageMode.UseNone)
{
pdfDocument.PageMode = Aspose.Pdf.PageMode.UseNone;
}

For the attached document we have set different zoom level, but using the below code we cannot able to get the various zoom level.
By default it is showing the zoom level as 1.0

strfile = “Magnification without Default200.pdf”;
Aspose.Pdf.Facades.PdfPageEditor anEditor = new Aspose.Pdf.Facades.PdfPageEditor(strfile);
float fzoom = anEditor.Zoom;

Please check and revert us ASAP.

Thanks
Naveenkumar S S

@naveenkumar_navitas_net

Thank you for contacting support.

Would you please share the source PDF file with us so that we may investigate further to help you out. In case the file size is larger that 3MB, please upload it to Google Drive, Dropbox etc and share the link with us.

support team,

Find the attached sample documents.

Thanks
Naveenkumar S Ssample docs.zip (1.0 MB)

@naveenkumar_navitas_net

We are afraid that presently there is no way to retrieve magnification property. We have logged an enhancement ticket with ID PDFNET-44942 in our issue tracking system. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.

Support Team,

We have to inform the client regarding this, so can you please share the release time for the ticket “PDFNET-44942” .

if you given solution before end of this month it would be greatly appreciated.

Thanks
Naveenkumar S S

@naveenkumar_navitas_net

The ticket PDFNET-44942 has recently been logged in our issue management system and is pending for investigations at the moment. It will be investigated on its due turn that can take several months. We will notify you as soon as the ticket will be resolved.

However, we also offer Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.

Support Team,

We are ok with the Paid Support.

If we raise the same concern in the Paid support, how long it will take to give the solution for the ticket PDFNET-44942

We need to share the release date to our customers.

Thanks
Naveenkumar S S

@naveenkumar_navitas_net

We are investigating this ticket and will let you know about the ETA as soon as some definite updates are available. Please be patient and spare us little time.

Hi,

Any updates on the timeline, customer is pushing for the release date.

Thanks
Naveenkumar S S

@naveenkumar_navitas_net

We can not share any ETA prior to initial investigations. We have recorded your concerns and will get back to you as soon as we can. We really appreciate your patience in this regard.

Hi,

I asked the ETA for paid support. Then only we can finalize to raise the same in priority support.

Thanks
Naveenkumar S S

@naveenkumar_navitas_net

We really value your concerns and realize significance of the issue. However, we are afraid that we are not yet in a position to share any reliable ETA. We will let you know as soon as some definite updates regarding the ETA will be available. Please spare us little more time.

Support Team,

Able to see the issue “PDFNET-44942” status as Closed. Can you please share the details for this fix.

Thanks
Naveenkumar S S

@naveenkumar_navitas_net

Thank you for getting back to us.

We are gathering some relevant details and will get back to you with our findings soon.

@naveenkumar_navitas_net

Thank you for being patient.

We would like to update you that, default magnification and position of the page and page are determined by “open action” which is executed when PDF document is opened.

OpenAction : array or dictionary
(Optional; PDF 1.1) A value specifying a destination that shall be displayed or an action that shall be performed when the document is opened. The value shall be either an array defining a destination (see 12.3.2, “Destinations”) or an action dictionary representing an action (12.6, “Actions”). If this entry is absent, the document shall be opened to the top of the first page at the default magnification factor.

Possible open action destinations are described in Table 151 “Destination syntax” in PDF specification (“PDF 32000-1:2008”):

[page /XYZ left top zoom]
[page /Fit]
[page /FitH top]
[page /FitV left]
[page /FitR left bottom right top]
[page /FitB]
[page /FitBH top]
[page /FitBV left]

(Please refer Table 151 in PDF spec. for more detailed description)

Every of these destination has corresponding class in Aspose.PDF for .NET API.
In order to read OpenAction please use OpenAction property of Document class.
Thus, open action could be analyzed for example in the following way:

        Document doc = new Document("source.pdf");
        if (doc.OpenAction == null)
        {
            Console.WriteLine("No action");
        }
        if (doc.OpenAction is GoToAction)
        {
            GoToAction openAction = doc.OpenAction as GoToAction;
            if (openAction.Destination is XYZExplicitDestination)
            {
                Console.WriteLine(((doc.OpenAction as GoToAction).Destination as XYZExplicitDestination).Zoom);
            }
            else if (openAction.Destination is ExplicitDestination)
            {
                Console.WriteLine("Fit page " + (openAction.Destination as ExplicitDestination).PageNumber);
                if (openAction.Destination is FitExplicitDestination)
                {
                    Console.WriteLine("FixExplicit");

                }
                else if (openAction.Destination is FitBHExplicitDestination)
                {
                    Console.WriteLine("Fit BH");
                }
                else if (openAction.Destination is FitHExplicitDestination)
                {
                    Console.WriteLine("Fit H");
                }
            }
        } 

We hope this will be helpful. Please share your kind feedback with us.