Is there a way to set "Enable Scrolling" in "Page Display"

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  Is there a way to set "Enable Scrolling" in "Page Display"

DynamicPDF CoreSuite for .NET (v10) Forum

Hi there,

I'm testing with the .NET v10.31.0 (Build 41601) evaluation edition to replace our current iText library.

I've having an issue that when viewing the merged pdf in Acrobat Reader DC, it's either set to "Enable Scrolling" or bookmarks sidebar opens by default, by that I mean, I couldn't achieve both.

With this sample code I could achieve "Enable Scrolling", but the left sidebar for bookmarks is hidden be default.
//////////////////////////////////////////
MergeDocument document = new MergeDocument();
MergeOptions mergeOptions = MergeOptions.All;
if (createBookmarks == true)
{
     //Create bookmark
    mergeOptions.Outlines = false;
    document.Outlines.Add(item.Key, new XYDestination(document.Pages.Count + 1, 0, 0));
}
document.Append(singlePDF, mergeOptions);
//////////////////////////////////////////

With this one I could achieve left sidebar displayed by default but it would be "Single Page View" in "Page Display"
//////////////////////////////////////////
MergeDocument document = new MergeDocument();
MergeOptions mergeOptions = MergeOptions.Append;
if (createBookmarks == true)
{
     //Create bookmark
    mergeOptions.Outlines = false;
    document.Outlines.Add(item.Key, new XYDestination(document.Pages.Count + 1, 0, 0));
}
document.Append(singlePDF, mergeOptions);
//////////////////////////////////////////

I've tried to go with MergeOptions.Append and then set properties like mergeOptions.OpenAction = true; and mergeOptions.DocumentProperties = true; but none of those worked.

Could you please let me know if there's a way to achieve both? As this is one of the requirements from clients.

Thanks,
Wenshuo

Posted by a ceTe Software moderator
Hello,

If you are looking to open a PDF with bookmark panel shown by default, you can set the IntialPageMode with the ShowOutlines property. Also please note that our API just sets this property in the PDF and opening the generated PDF is handled by the PDF Reader or Viewer. Below is a code sample:

           PdfDocument pdf = new PdfDocument(@"Input PDF file path");
            MergeDocument document = new MergeDocument(pdf);
            document.InitialPageMode = PageMode.ShowOutlines;
            //document.InitialPageMode = PageMode.ShowNone;
            document.Draw(@"Output PDF file path");

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 11:05 AM.