Thanks for sharing requested files and code snippet.
I have narrowed down your code snippet, in order to test the scenario and found that problem was occurring due to setting
Width of the page according to image dimensions. Since you were setting page height/width same as of image and also setting the page margins, the API was unable to render the TIFF image inside PDF (because page width/height + margin values were higher than those of, you were setting in the code snippet) and taking time to save the document.
In case you want to generate PDF document with all side margin value as 5, you need to add this value for height and width of the PDF Pages as well (e.g Top Margin = 5, Bottom Margin = 5 => Height = imageHeight + 10). Modifying following lines of shared code snippet, have resolved the issue and an output PDF document is also attached for your reference.
currpage.PageInfo.Width = pWidth + 10
currpage.PageInfo.Height = pHeight + 10
In case of any further assistance, please feel free to contact us.