Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在iOS中将pdf文件适配到web视图中_Html_Ios_Iphone_Pdf_Uiwebview - Fatal编程技术网

Html 在iOS中将pdf文件适配到web视图中

Html 在iOS中将pdf文件适配到web视图中,html,ios,iphone,pdf,uiwebview,Html,Ios,Iphone,Pdf,Uiwebview,我想在web视图中显示pdf文件。web视图可能只包含文本或文本+pdf、文本+图像等 它对我来说很好,但是当web视图有pdf时,它的高度和宽度不适合web视图框架。我可以水平和垂直滚动来查看它。此外,如果pdf有多页,则其高度不可调整。 尝试1 web.scalesPageToFit=YES; 问题:所有内容都很小,看起来很难看 尝试2次 [web setContentMode:UIViewContentModeScaleAspectFit]; [web setAutoresizingMa

我想在web视图中显示pdf文件。web视图可能只包含文本或文本+pdf、文本+图像等

它对我来说很好,但是当web视图有pdf时,它的高度和宽度不适合web视图框架。我可以水平和垂直滚动来查看它。此外,如果pdf有多页,则其高度不可调整。

尝试1

web.scalesPageToFit=YES;
问题:所有内容都很小,看起来很难看

尝试2次

[web setContentMode:UIViewContentModeScaleAspectFit];
[web setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
问题:不工作

尝试3次

[web loadHTMLString:[NSString stringWithFormat:@"<html><head><meta name='viewport' content='width:05px; initial-scale=0.5; maximum-scale=1.0; user-scalable=0;'/></head>
<body><div style='font-size:14px; font-family:Opensans';>
<object style='width:100%; height:100%' type='application/pdf' data='http://www.eecs.harvard.edu/econcs/pubs/online.pdf'></object><p>ab sofort!</p></div>
</body></html>"] baseURL:nil];
[web loadHTMLString:[NSString stringWithFormat:@]
ab sofort

“]baseURL:nil];
问题:无法工作,pdf仅显示一半

尝试4次

[web_large loadHTMLString:@"<object style='width:620px; height:950px' type='application/pdf' data='http://www.eecs.harvard.edu/econcs/pubs/online.pdf'></object><p>ab sofort!</p>\n" baseURL:nil];
[web\u大负载htmlstring:@”ab sofort!

\n“baseURL:nil];
问题:宽度是可水平滚动的,高度是固定的,因此不适用于多页pdf

谢谢


请回答任何问题

@AvijitNagare,这不是重复的问题!我的问题是适合pdf文档webview@AvijitNagare,这不是重复的问题!我的问题是webview中的fit pdf文档