بدلاً من تنزيل ملف PDF، كيف يمكن إجبار ملف PDF على فتحه/عرضه في المتصفح فقط؟

Whenever I upload a PDF, it shows in the topic as follows:

image

I’m using Inline PDF to display it in Desktop version. But, in mobile Inline PDF won’t work. Further, Google or other search engines autodetect the PDF files, but whenever the user clicks on those results, the PDF download dialogue will appear instead of opening in a tab. This is a bit unfriendly and most of the users prefer to view the PDF online instead of downloading it at a place and opening.

Is there any solution to this?

NOTE: I’ve seen this topic PDF preview instead of download, on uploaded files, but the topic ended without any relation to the original question. Hence, this new topic.

7 إعجابات

Thanks for raising this question. I’m also curious to know the answer!

3 إعجابات

تضمين ملف PDF مخزن على Google Drive

يتم عرض ملفات PDF على الأجهزة المحمولة وكذلك على أجهزة سطح المكتب.

(طريقتي المفضلة لعرض ملفات PDF في إطارات iFrames على أي جهاز بشكل متجاوب)

  1. مشاركة
  2. نسخ رابط المشاركة
  3. فتح رابط المشاركة في علامة تبويب جديدة
  4. النقر على النقاط الرأسية الثلاث في الزاوية العلوية اليمنى
  5. تحديد “تضمين العنصر” (Embed Item)
  6. نسخ كود الإطار (iFrame) المعروض
  7. لصقه في مربع إنشاء المشاركات / المحرر في Discourse

مثال لسطح المكتب…

مثال للجوال…

إعجابَين (2)

الملف المضمن بتنسيق PDF لا يعمل لدي على سطح المكتب أيضًا.

أنجح جزئيًا في عرض ملفات PDF مضمنة عند إضافتها إلى FileHelper.inline_images

ولكن بعد ذلك يلزم وجود معلمة “inline=1”:

يمكن إضافة هذا في بعض مكونات السمات (Inline PDF Previews).

أود تعلم طريقة نظيفة لتبديل Discourse لتقديم ملفات PDF مع content-disposition: inline باستخدام مكون إضافي أو خيار تكوين.

تمكنت من كتابة إضافة صغيرة لهذا الغرض:

4 إعجابات